Info
この質問は閉じられています。 編集または回答するには再度開いてください。
combine cell array to new big cell
2 ビュー (過去 30 日間)
古いコメントを表示
hi I have 4 cells containing PID, fullname, Exam and Date. ex
PID(1,1) = 0000000000
FN(1,1) = Will smith
Exam(1,1) = MUGA, UE
Date(1,1)= 27/03/2017
They are all (55x1) but the 55 can vary.
I need a BIG cell, BC (n,4): - it is important that it is four columns.
BC{n,1} = {PIDS{n,1}; FN{n,1}; Exam{n,1}; Date{n,1}};
BC{n,2} = {PIDS{n,2}; FN{n,2}; Exam{n,2}; Date{n,2}};
BC{n,3} = {PIDS{n,3}; FN{n,3}; Exam{n,3}; Date{n,3}};
BC{n,4} = {PIDS{n,4}; FN{n,4}; Exam{n,4}; Date{n,4}};
Can anyone help me with that ?
0 件のコメント
回答 (1 件)
Star Strider
2017 年 4 月 3 日
‘They are all (55x1) but the 55 can vary.’
Yet here for example, you are asking for the second column of a one-column vector:
BC{n,2} = {PIDS{n,2}; FN{n,2}; Exam{n,2}; Date{n,2}};
That will never work.
See if:
for n = 1:size(PIDS,1)
BC{n} = {PIDS{n}; FN{n}; Exam{n}; Date{n}};
end
works in your application.
0 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!