File: matrix.cat

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (38 lines) | stat: -rw-r--r-- 1,217 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
matrix            Scilab Group            Scilab Function            matrix
NAME
   matrix - reshape a vector or a matrix to a different size matrix
  
CALLING SEQUENCE
 y=matrix(v,n,m)
 y=matrix(v,[sizes])
PARAMETERS
 v          : a vector, a matrix or an hypermatrix 
            
 n,m        : integers
            
 sizes      : vector of integers
            
 y          : a vector  matrix or hypermatrix
            
DESCRIPTION
   For a vector or a matrix with n x m entries y=matrix(v,n,m) or similarily
  y=matrix(v,[n,m]). transforms the v vector (or matrix) into an nxm matrix
  by stacking columnwise the entries of v.
  
   if one of the dimension m or n is equal to -1 it is automatically
  assigned  to the quotient of  size(v,'*') by the other dimension,
  
    For an hypermatrix such as prod(size(v))==prod(sizes),y=matrix(v,sizes)
  (or equivalently y=matrix(v,n1,n2,...nm)) transforms v  into an  matrix
  or hypermatrix by  stacking columnwise the entries of v.
  y=matrix(v,sizes) results in a regular matrix if sizes is a scalar or a
  2-vector. 
  
SEE ALSO
   matrices, hypermatrices, ones, zeros, rand, poly, empty
  
EXAMPLES
 a=[1 2 3;4 5 6]
 matrix(a,1,6)
 matrix(a,1,-1)
 matrix(a,3,2)