How do i store new data into an existing cell array?
2 ビュー (過去 30 日間)
古いコメントを表示
Assuming i have a cell array:
myArray = {NaN, 'm', 'b', NaN};
And i have a while loop within which i call the function that produces a new result:
myArray = {NaN, NaN, NaN, 'n'};
How do i append the new result into the existing one such that i still have a 1x4 array with the cells as follows:
[{NaN, NaN}] [{'m', NaN}] [{b, NaN}] [{NaN, 'n'}]
Thank you in advance!.
0 件のコメント
回答 (1 件)
ES
2017 年 3 月 17 日
once you have myArray = {NaN, 'm', 'b', NaN}; and myArray 1 = {NaN, NaN, NaN, 'n'};, you can run a for loop over them and concatenate.
for iloop=1:4
output{iloop,1} = myArray{iloop};
output{iloop,2} = myArray1{iloop};
end
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!