|
TNTmips Downloads Menu

|
addmatsc.sml
################################################################
# AddMatrixScaler(matrix, value)
################################################################
clear();
class MATRIX h1;
h1 = CreateMatrix(2,2); # create a matrices
# fill the matrices with some values
numeric r, c;
for r = 0 to 1 {
for c = 0 to 1 {
SetMatrixItem( h1, r, c, r + c );
}
}
# print the matrix
printf( "origional matrix\n" );
PrintMatrixToConsole( h1 );
AddMatrixScaler(h1, 100.0); # add 100.0 to each element
# print the resulting matrix
printf( "after adding 100.0 to each element\n" );
PrintMatrixToConsole( h1 );
# destroy the matrix
DestroyMatrix(h1);
©MicroImages, Inc. 2013 Published in the United States of America
11th Floor - Sharp Tower, 206 South 13th Street, Lincoln NE 68508-2010 USA
Business & Sales: (402)477-9554 Support: (402)477-9562 Fax: (402)477-9559
Business info@microimages.com
Support support@microimages.com
Web webmaster@microimages.com
| |