When the three builtin-in functions zeros,
ones, and rand are called to create matrix, a final optional argument can
be used to specify the storage type of the elements of the matrix. The value of
the argument can be
_Z, _B, _L, or _M, for
int,
byte,
long, and
mpf respectively.
To create a int matrix of 0's or 1's, use the command
x = zeros(3, 5, _Z);
or
x = ones(3, 5, _Z);
To create a column vector of 5 bytes of random values between 0 and 255, use the command
x = rand(5, _B);
or
x = rand(1, 5, _B);
To create a row vector of 5 binaries, use the command binary(5).
oz
2009-12-22