how to extract minimum matrix by cellfun

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by