Regarding calling of matrix outside for loop

2 ビュー (過去 30 日間)
Ravi mutturi
Ravi mutturi 2011 年 9 月 21 日
Being non-expert in Matlab, I have a problem regarding calling a matrix outside for loop.
code:
for i=1:1:4
Mat = rand(2)
end
Output
Mat =
0.9644 0.6948
0.4325 0.7581
Mat =
0.4326 0.1098
0.6555 0.9338
Mat =
0.1875 0.7978
0.2662 0.4876
Mat =
0.7690 0.2729
0.3960 0.0372
Now i want a updated matrix which basically includes all the above four matrices as 2x8 matrix. I mean updated matrix = [Mat for i=1, Mat for i=2...upto i =4]
kindly help

採用された回答

Harry MacDowel
Harry MacDowel 2011 年 9 月 21 日
Combined = []
for i=1:1:4
Mat = rand(2);
Combined = [Combined;Mat];
end
  2 件のコメント
Ravi mutturi
Ravi mutturi 2011 年 9 月 21 日
worked perfect.
thanks
Harry MacDowel
Harry MacDowel 2011 年 9 月 21 日
you're welcomed

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by