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 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