I am trying to us the randomMatrix function using the example in the documentation.
when i write :
linalg::randomMatrix(2, 2, Dom::Integer)
I get: Error: Unexpected MATLAB operator.

 Respuesta aceptada

Sean de Wolski
Sean de Wolski el 14 de Nov. de 2013
This is a MuPad command. To run it, open a MuPad note book and run it there:
mupad %or click the app.
And for more info:
doc mupad
If you just want a random integer matrix in MATLAB look at randi
randi(10,2,2)
And for more info:
doc randi

2 comentarios

Assaf
Assaf el 14 de Nov. de 2013
Thanks, and if I want an m by n matrix with each row having the numbers 1 to n in a random order?
You could use randperm in a loop or:
m = 5;
n = 9;
[~,R] = sort(rand(m,n),2)

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 14 de Nov. de 2013

Comentada:

el 14 de Nov. de 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by