converting randit to randi
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Randit it obsolete in newer versions of Matlab.
Can anyone guide me how to convert randit(1,1,9) to randi?
Respuestas (2)
Walter Roberson
el 11 de Jun. de 2019
https://www.mathworks.com/matlabcentral/answers/376258-what-does-x-randint-1-1-1-n#comment_522862
0 comentarios
Dennis
el 11 de Jun. de 2019
matrix(i,j)=randi(9);
Instead of creating single random numbers in a loop maybe consider creating them as vector/matrix.
matrix=randi(9,10,10); %10x10 matrix with random numbers from 1-9
instead of
matrix=zeros(10,10);
for i=1:10
for j=1:10
matrix(i,j)=randi(9);
end
end
0 comentarios
Ver también
Categorías
Más información sobre Get Started with MATLAB en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!