How do I store all values of a loop in a vector?
1 回表示 (過去 30 日間)
古いコメントを表示
for i=1:100000;
x=randi(6)+randi(6);
end;
I am trying to find an average across all values of x and need to save them all as a vector and can't figure out how
1 件のコメント
Dyuman Joshi
2024 年 4 月 19 日
An alternate method without loop -
x = randi(6,1,1e5) + randi(6,1,1e5);
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!