Continuous and repetitive gaussian random function in matlab
조회 수: 5 (최근 30일)
이전 댓글 표시
I want to create a random rough surface profile as input form my method. I can able to create random variation in numbers using randn function but each time i simulate i get different input data which changes output. If it is possible to store and use the data or to generate a continuous function of random data which can be repetative if done simulaion that would be helpful
댓글 수: 2
KALYAN ACHARJYA
2019년 9월 17일
Hello Rakesh, can you show the plot you are looking for (use paint or any drawing tool)?
채택된 답변
Stephan
2019년 9월 17일
If i understood you correctly, you want to get the same random values every time you run your code. This is reached by the rng function.
rand(1,10)
ans =
0.4387 0.3816 0.7655 0.7952 0.1869 0.4898 0.4456 0.6463 0.7094 0.7547
s = rng
s =
struct with fields:
Type: 'twister'
Seed: 0
State: [625×1 uint32]
rng(s)
rand(1,10)
ans =
0.2760 0.6797 0.6551 0.1626 0.1190 0.4984 0.9597 0.3404 0.5853 0.2238
rng(s)
rand(1,10)
ans =
0.2760 0.6797 0.6551 0.1626 0.1190 0.4984 0.9597 0.3404 0.5853 0.2238
댓글 수: 2
추가 답변 (0개)
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!