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!