Array Question time again
1 回表示 (過去 30 日間)
古いコメントを表示
Hey Guys, I have an 54x4 Array and every entry is another Array holding numbers. No i want to combine every line of the big array.
'J' 'J' 'J' 'J'
[1x41 double] [1x41 double] [1x41 double] [1x41 double]
[1x41 double] [1x41 double] [1x41 double] [1x41 double]
the goal is an an 1x161 Array named x. How can i combine this Arrays ?
採用された回答
Azzi Abdelmalek
2014 年 7 月 31 日
A={1:4 5:8 9:12;20:23 24:27 28:31}
B=num2cell(cell2mat(A),2)
2 件のコメント
Azzi Abdelmalek
2014 年 7 月 31 日
編集済み: Azzi Abdelmalek
2014 年 7 月 31 日
A={'j' 'j' 'j';1:4 5:8 9:12;20:23 24:27 28:31}
B=A(2:end,:)
out=num2cell(cell2mat(B),2)
その他の回答 (1 件)
Ahmet Cecen
2014 年 7 月 31 日
Assuming this is a cell array, the naivest way to go is:
X=zeros(54,164);
for i=1:54
X(i,:)=[OldArray{i+1,1} OldArray{i+1,2} OldArray{i+1,3} OldArray{i+1,4}]; %i+1 because of the first row having j' j' j' j'.
end
Now ever row of X is an x vector as you requested.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!