フィルターのクリア

How Looping Values Form in Array 's

2 ビュー (過去 30 日間)
SAMEER ahamed
SAMEER ahamed 2014 年 2 月 18 日
編集済み: SAMEER ahamed 2014 年 2 月 20 日
Hi, I want to form Array List , I have values like below ? how i can get ? Example Below Code Values are 8-by-1 matrix :
if true
% code
for int i = 1:12
matrtix{i} =[[left_distance_X; left_distance_Y ;right_distance_X ;right_distance_Y; upper_distance_X; upper_distance_Y; bottom_distance_X ;bottom_distance_Y]]; %Here these values are dynamic values
disp(matrix{i});
end
end
Output Result i have got like :
matrix{1}= 22 33 22 22 44 222 33
matrix{2}=99 33 22 55 66 88 22 22
matrix{12}= 33 44 22 64 09 98 44 44.
*I would like to store like matrix* =[[22 ,33 ,22, 22 ,44, 222, 33],[99 ,33 ,22, 55, 66, 88, 22, 22]];
  1 件のコメント
SAMEER ahamed
SAMEER ahamed 2014 年 2 月 19 日
Hi,
how i can form my 8-by-1 result like : matrix =[[22,44,45,87,42,11,44,66],[21,3,45,5,77,5,121,432]];

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

採用された回答

Jos (10584)
Jos (10584) 2014 年 2 月 19 日
If all elements of the cell array matrix have the same number of columns you can concatenate them row-wise:
out = cat(1, matrix{:})
  1 件のコメント
SAMEER ahamed
SAMEER ahamed 2014 年 2 月 20 日
編集済み: SAMEER ahamed 2014 年 2 月 20 日
Thank's for reply me , I'm newbie for mat-lab ,now I have got result like below
if true
% code
disp(out);
30
23
77
23
53
8
53
35
31
25
72
25
46
15
46
42
17
24
71
24
43
14
43
39
16
22
69
22
44
3
44
38
24
23
73
23
48
8
48
39
23
21
72
21
46
8
46
36
23
23
72
23
46
9
46
38
22
19
71
19
45
6
45
35
26
23
72
23
47
11
47
36
end
*Now i want to form like 1-by-8 matrix out =[[30,23,77,23,53,8,53,35],[31,25,72,25,46,15,46,42].....etc];*

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

タグが未入力です。

製品

Community Treasure Hunt

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

Start Hunting!

Translated by