フィルターのクリア

Simple question about for loop

3 ビュー (過去 30 日間)
주희 박
주희 박 2022 年 5 月 11 日
編集済み: Matt J 2022 年 5 月 11 日
Hi I have cell data that consist of different row size like below picture. Let's assume this name of this cell is A.
And I want to make simple for loop
B= zeros(length(A), ???);
for i = 1: length(A)
b= function{i};
B(i,:)=b;
end
Each row has different size.
I wonder what should i write in ???.

採用された回答

Matt J
Matt J 2022 年 5 月 11 日
編集済み: Matt J 2022 年 5 月 11 日
There is no way to know from the code you've shown. You've shown us the dimensions of A{i}, but not of b. In any case, you might consider using cellfun instead,
B=cell2mat( cellfun(@(z) reshape(func(z),[],1), A,'uni',0) )

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by