フィルターのクリア

PADCAT on cells with nested cells

1 回表示 (過去 30 日間)
jenifer Ask
jenifer Ask 2019 年 12 月 28 日
編集済み: jenifer Ask 2019 年 12 月 30 日
try to use Padcat function on my cells, but I can't, because my cells include nested cells, Attached my fils (6*47). (6 is number my images).
how to change this code to access the correct result (matrix with size 6*n)?
load ('rotate.mat')
a_2=rotatedImage;
for i=1:6
[m{i}, tf{i}] = padcat(a_2(i,:))'; % concatenate, pad rows with NaNs
m{i}(~tf{i}) = 0 % replace N
vec_rotate{i}= cell2mat(a_2(i,:))' ;
vec_rotate{i}=vec_rotate(i,:)'
end
  7 件のコメント
Stephen23
Stephen23 2019 年 12 月 29 日
編集済み: Stephen23 2019 年 12 月 29 日
As far as I can tell, you are trying to do something like this:
C = cellfun(@(a)a(:).',Gmag,'uni',0); % all matrices -> row vectors
C(cellfun(@isempty,C)) = {zeros(1,9)}; % replace empty arrays with zeros
M = cell2mat(C); % convert to 6x423 numeric matrix
jenifer Ask
jenifer Ask 2019 年 12 月 29 日
編集済み: jenifer Ask 2019 年 12 月 30 日
It's amazing ... thank you very much

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

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by