How create a random sequence
7 次查看(过去 30 天)
显示 更早的评论
Hi, I want to create a random sequence of 10 elements with values +- 2.How can i do it?
BR,
José Manuel.
1 个评论
the cyclist
2013-11-24
Do you want only values of -2 and 2, or continuous values uniformly in between, like -1.732 and 0.365?
采纳的回答
the cyclist
2013-11-24
编辑:the cyclist
2013-11-24
Just -2 and 2:
R = 4*round(rand(1,10)) - 2;
Continuous:
R = 4*rand(1,10) - 2;
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!