Octave:Vectorization
From AIMSWiki
WARNING: This page is still under heavy construction
Return to the Octave index
| Table of contents |
[edit]
Matrix
[edit]
Matrix
[edit]
Syntaxis
The syntax of the Octave function is a follows:
Variable = [x11, x12, ..., x1n; x21, x22, ..., x2n; xm1, xm2, ..., xmn ]
Where m is the number of rows and n is the number of columns in a m x n matrix.
Matrices and arrays are entered in square brackets, []. Row arrays can be defined using either commas or spaces. Columns are defined by semicolons to separate the elements.
Example of a single row.
>> A = [1, 2, 3, 4]
A =
1 2 3 4
Example of a single column.
>> B = [1; 2; 3; 4] B = 1 2 3 4
Example of a 3 x 4 matrix.
>> C = [ 1 2 3 4; 5 6 7 8; 9 10 11 12] C = 1 2 3 4 5 6 7 8 9 10 11 12
[edit]
External Links
- Wikibooks MATLAB Programming/Arrays (http://en.wikibooks.org/wiki/MATLAB_Programming/Arrays)

