% MotionGenesis file: MGMatrixExample.txt zeroMat23 = GetZeroMatrix( 2, 3 ) identity33 = GetIdentityMatrix( 3, 3 ) M = [1, 2; 3, sin(t)] % 2 x 2 matrix. add = M + M mult5 = 5 * M multM = M * M divide = M / 2 transpose = GetTranspose( M ) det = GetDeterminant( M ) trace = GetTrace( M ) derivative = Dt( M ) inv = GetInverse( M ) eigValues = GetEigen( M ) element12 = M[ 1, 2 ] % Element in 1st row, 2nd column. element12 = GetElement( M, 1, 2 ) row2 = GetRow( M, 2 ) % Extract row 2 of M. col2 = GetCol( M, 2 ) % Extract column 2 of M. extractRows = GetRow( M, 2, 1 ) % Extract rows 2 and 1 of M. colTwice = GetColumns( M, 2, 2 ) % Extract column 2 of M twice. MM = [ M, M ] % 2 x 4 matrix. Metc = [ M, 7*M, GetIdentityMatrix(2,2) ] extract = Metc[ 1:2, 3:6 ] % Extract rows 1-2 and columns 3-6. Save MGMatrixExample.html Quit