matlab R2020b randperm fuction is not random
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
俊 马
el 14 de Jul. de 2022
Comentada: 俊 马
el 19 de Jul. de 2022
Hi,
When I use matlab R2020b on linux platform, commands follow:
order = randperm(10)
disp(order)
results show:
6 3 7 8 5 1 2 4 9 10
6 3 7 8 5 1 2 4 9 10
Curiously, the result is fixed,i.e., when I run this script again, the same results appear. Does anybody know what's wrong? thanks
Respuesta aceptada
Fangjun Jiang
el 14 de Jul. de 2022
Duh! You store the result in "order" and display it again. Of course they are the same!
order = randperm(10)
disp(order)
order = randperm(10)
disp(order)
Más respuestas (0)
Ver también
Categorías
Más información sobre MATLAB Coder 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!