how to extract minimum matrix by cellfun

1 回表示 (過去 30 日間)
nadia nadi
nadia nadi 2015 年 8 月 20 日
編集済み: Matt J 2015 年 9 月 16 日
Dear All,
I have many matrix when I want to find the maximum one by using the size I get the right answer but for minimum matrix I got empty matrix. I used this code
for i=1:10
MaxSubmat=load('MaxSubmatfile.txt');
Remind=load('Remindfile.txt');
ee{i}=MaxSubmat;
aa{i}=Remind;
end
[SizeMaxSubmat,MaxSubmat1]=max(cellfun(@(x) size(x,2),ee ))
[SizeRemind, Remind1]=min(cellfun(@(x) size(x,2),aa ))
MaxSub=ee{MaxSubmat1};
Reminder=aa{Remind1};
sizeReminder=size(Reminder,2)
I don't why it give give Reminder=[] and sizeReminder= 0 for while I know is more than one.
could anyone help me with this code I will appreciate that a lot.
regards, Nadia

回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by