Methods for Defining Arrays
Define the matrix row and column index variables using range variables.
Keyboard Sequence
Result
r:0..3
c:0..3
X[r,c:r^2+c/2
X=
Use the index operator to set the bottommost corner element to a specific value. Unspecified elements are set to zero.
Keyboard Sequence
Result
M[4,5:1
M=
Use the index operator to define specific elements in a row vector.
Keyboard Sequence
Result
v:[0Shift+Space1Shift+Space2
Shift+Space3Shift+Space4
v[1:1+3i
v[3:”test
v=
Use the index operator to define specific elements in a column vector.
Keyboard Sequence
Result
u:[0Shift+Enter1Shift+Enter2
Shift+Enter3Shift+Enter4
u[1:1+3i
u[3:”test
u=
Use the identity function to create a square matrix and set its diagonal elements to 1.
Keyboard Sequence
Result
identity(5=
Was this helpful?