File: matrix.man

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 (49 lines) | stat: -rw-r--r-- 1,232 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
39
40
41
42
43
44
45
46
47
48
49
.TH matrix 1 "April 1993" "Scilab Group" "Scilab Function"
.so ../sci.an
.SH NAME
matrix - reshape a vector or a matrix to a different size matrix
.SH CALLING SEQUENCE
.nf
y=matrix(v,n,m)
y=matrix(v,[sizes])
.fi
.SH PARAMETERS
.TP 10
v
: a vector, a matrix or an hypermatrix

.TP 10
n,m
: integers
.TP 10
sizes
: vector of integers
.TP 10
y
: a vector  matrix or hypermatrix
.SH DESCRIPTION
For a vector or a matrix with \fVn\fR x \fVm\fR entries
\fVy=matrix(v,n,m)\fR or similarily \fVy=matrix(v,[n,m])\fR.
transforms the \fVv\fR vector (or matrix) into an \fVnxm\fR matrix by
stacking columnwise the entries of \fVv\fR.
.LP
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,
.LP

For an hypermatrix such as
\fVprod(size(v))==prod(sizes)\fR,\fVy=matrix(v,sizes)\fR (or
equivalently \fVy=matrix(v,n1,n2,...nm)\fR) transforms
\fVv\fR  into an  matrix or hypermatrix by 
stacking columnwise the entries of \fVv\fR. \fVy=matrix(v,sizes)\fR
results in a regular matrix if sizes is a scalar or a 2-vector.

.SH SEE ALSO
matrices, hypermatrices, ones, zeros, rand, poly, empty
.SH EXAMPLES
.nf
a=[1 2 3;4 5 6]
matrix(a,1,6)
matrix(a,1,-1)
matrix(a,3,2)
.fi