Convert a cell array (each cell having different no. of elements) to matrix

8 ビュー (過去 30 日間)
NotA_Programmer
NotA_Programmer 2022 年 5 月 2 日
コメント済み: NotA_Programmer 2022 年 5 月 2 日
I want to convert a cell array of (7886 x 1 cell) to matrix (7886 x :) whose no. of row elements are not consistent and are of a type double. Can anyone help how to convert this, as cell2mat does not support inconsistent no. of elements
A = cell2mat(b);
Error:
Error using cat
Dimensions of arrays being concatenated are not consistent.
Error in cell2mat (line 83)
m{n} = cat(1,c{:,n});

採用された回答

Stephen23
Stephen23 2022 年 5 月 2 日
Download PADCAT from here:
and use it like this:
A = padcat(b{:});

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by