generate same random matrix in another computer..
8 ビュー (過去 30 日間)
古いコメントを表示
Abhishek sadasivan
2014 年 9 月 12 日
コメント済み: Abhishek sadasivan
2014 年 9 月 13 日
Hai ..I have a doubt ,whether it is possible to get same random matrix in another computer where same matlab software is installed . consider A= rand(2,3) when I entered this in my computer in home .I got A= 0.8147 0.1270 0.6324 0.9058 0.9134 0.0975 I would like to send A matrix to my computer in my office.Instead of sending the full matrix A ,I would like to generate the same random matrix in my office ..whether it is possible ???..
0 件のコメント
採用された回答
その他の回答 (1 件)
Guillaume
2014 年 9 月 12 日
random number generators are not really random, they just generate a sequence of numbers that appear random using formulas based on an internal state. If you set the same internal state the formula give you the same number.
Normally, you do not want the number generation to be reproducible, so you initialise the state with something unpredictable, like the current time but you can also initialise it with a fixed state. You use rng to initialise the state, Thus start your program on both computers with
rng(any_positive_number_of_your_choosing)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!