Concatenate two cell arrays in matlab

1 回表示 (過去 30 日間)
Hina Iqbal
Hina Iqbal 2015 年 3 月 12 日
コメント済み: Hina Iqbal 2015 年 3 月 12 日
I have array as
A=cell(4,1);
A=[1;2;3;4];
i have to increase the size of A. i.e to make it 8 for example. when i pad the zeros or simply vertically concatenate the two array(one is A and other is simply e.g B=cell(4,1))
I get the answer like
[4x1 double]
[]
[]
[]
[]
whereas i need output like
1
2
3
4
[]
[]
[]
[]
or if padding zeros then
1
2
3
4
0
0
0
0
plz help me as i need this urgent.. i have tried alot..it works when A matrix is simply an array not a cell array..but in my case i need this for cell array|
  1 件のコメント
Jan
Jan 2015 年 3 月 12 日
Please post the code you use to create the shown data. It is not clear if A is a cell or a matrix.

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

採用された回答

Andrei Bobrov
Andrei Bobrov 2015 年 3 月 12 日
編集済み: Andrei Bobrov 2015 年 3 月 12 日
A = cell(8,1);
A(1:4) = num2cell((1:4)');
numeric array
A = zeros(8,1);
A(1:4) = (1:4)';
  1 件のコメント
Hina Iqbal
Hina Iqbal 2015 年 3 月 12 日
Thank you so much:-)

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

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