フィルターのクリア

How to open a cell array??

2 ビュー (過去 30 日間)
Gabriela Dorneles
Gabriela Dorneles 2021 年 3 月 14 日
コメント済み: Gabriela Dorneles 2021 年 3 月 15 日
I have teh following cell array. Each cell is a row of 6 or 8 colmns.
I needed a it to put each cell array in one row and make it complete the rest of the cell with zeros ou NaN.
Like:
{ 1 2 3 4 5 6} ; {1 2 3 4 5 6 7 8} ; { 1 2 3 4 5 6}
1 2 3 4 5 6 0 0
1 2 3 4 5 6 7 8
1 2 3 4 5 6 0 0

採用された回答

ANKUR KUMAR
ANKUR KUMAR 2021 年 3 月 15 日
out=zeros(length(result_pettitt),max(cellfun(@(x) length(x), result_pettitt)));
for kk=1:length(result_pettitt)
out(kk,1:length(result_pettitt{kk}))=cell2mat(result_pettitt{kk});
end
  1 件のコメント
Gabriela Dorneles
Gabriela Dorneles 2021 年 3 月 15 日
Thank you!!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Types についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by