how to extract minimum matrix by cellfun

1 visualizzazione (ultimi 30 giorni)
nadia nadi
nadia nadi il 20 Ago 2015
Modificato: Matt J il 16 Set 2015
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

Risposte (0)

Categorie

Scopri di più su Matrices and Arrays in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by