Concat and display embedded arrays

2 ビュー (過去 30 日間)
Vineet Guru
Vineet Guru 2013 年 6 月 1 日
Can anyone help me to understand why when I try to concat Array B, I can't see the rows (10) and cols (5).
A = [];
B = [];
for j = 1:10
for i=1:5
x=randi(3);
Ai = x;
A = [A;Ai];
end
B{j} = A';
B = [B; B{j}];
end
Thanks.
  2 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 6 月 1 日
Is there any error message? What do you mean by : I can't see the rows (10) and cols (5)
Vineet Guru
Vineet Guru 2013 年 6 月 1 日
No there is no error. The output is: B =
[1x5 double]
[1x10 double]
[1x15 double]
[1x20 double]
[1x25 double]
[1x30 double]
[1x35 double]
[1x40 double]
[1x45 double]
[1x50 double]
[1x50 double]
The output should be:
B =
2 3 1 3 1
1 3 2 2 1
3 1 2 3 3
etc..

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

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 6 月 1 日
編集済み: Azzi Abdelmalek 2013 年 6 月 1 日
B = [];
for j = 1:10
A = [];
for i=1:5
x=randi(3);
A=[A;x];
end
B =[B;A']
end
  1 件のコメント
Vineet Guru
Vineet Guru 2013 年 6 月 1 日
Ahh... why was I going around in circles...
Thanks for your help.
Much appreciated!!!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTables についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by