I want to create a vector that has incremental random steps, I've used this simple code.
t_inici=(0:10*rand:100);
The problem is that the random keeps unchangable between steps. Is there any simple way to change the seed of the random number within each step?
thanks.

답변 (1개)

John D'Errico
John D'Errico 2018년 3월 23일

0 개 추천

Ye gods. Why would you need to change the seed?
You want it to start at 0, and end at 100? In 10 steps?
t_inici = [0,sort(rand(1,8)*100),100];

카테고리

도움말 센터 및 File Exchange에서 Random Number Generation에 대해 자세히 알아보기

질문:

2018년 3월 22일

답변:

2018년 3월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by