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.

 Akzeptierte Antwort

Sean de Wolski
Sean de Wolski am 14 Nov. 2013

0 Stimmen

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 Kommentare

Assaf
Assaf am 14 Nov. 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)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by