trying to combine cells
古いコメントを表示
I have 3 cells [1x5000] , [1x3000] and [1x2000] and I want to combine these in one cell [1x10000]. With small dimensions you can try the copy paste but now this is very slow procedure.
Do you have any ideas?
Thanks in advance!
採用された回答
その他の回答 (5 件)
yagnesh
2013 年 5 月 24 日
0 投票
suppose x is [1x5000] , y is [1x3000] and z is [1x2000]
xyz=[x;y;z]
nicolas
2013 年 5 月 24 日
0 投票
1 件のコメント
Image Analyst
2013 年 5 月 24 日
It's just one line - see my comment under my answer.
Andrei Bobrov
2013 年 5 月 24 日
A = {X,Y,Z};
ii = hankel([0 5000],[5000 8000 10000]);
C = arrayfun(@(x)A{x}(ii(1,x)+1:ii(2,x)),1:numel(A),'un',0);
out = {[C{:}]};
nicolas
2013 年 5 月 24 日
0 投票
2 件のコメント
Image Analyst
2013 年 5 月 24 日
Yes, cell arrays are almost always complicated. Can't you work with just normal old reliable numerical arrays? It would be so much simpler.
nicolas
2013 年 5 月 24 日
カテゴリ
ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!