フィルターのクリア

Concatenating cell array elements

4 ビュー (過去 30 日間)
Pal
Pal 2013 年 6 月 30 日
Hi,
Suppose I have two cell arrays, A and B. Both cell arrays are of size 1 X n and size(A{i}) = size(B{i}) for all i = 1:n. Thus, for example
A =
[1x3 double] [1x4 double] [1x6 double] ...
and
B =
[1x3 double] [1x4 double] [1x6 double] ...
I want to concatenate A and B such that the result C will look like
C =
[2x3 double] [2x4 double] [2x6 double] ...
In C, C{i}(1,:) = A{i} and C{i}(2,:) = B{i} for all i = 1:n.
What's the quickest way to do this?
I appreciate your help.

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 6 月 30 日
C= cellfun(@(x,y) [x;y],A,B,'un',0)
  1 件のコメント
Pal
Pal 2013 年 6 月 30 日
Thanks!

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

その他の回答 (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