Info

This question is closed. Reopen it to edit or answer.

Multiple embedded IF Statements

1 view (last 30 days)
Aldo Amaya
Aldo Amaya on 20 Feb 2014
Closed: MATLAB Answer Bot on 20 Aug 2021
Hi All, I am currently piloting a new tracking system for rodent behavior. These are the same video files for a single cohort 87 trials and each is being separated by center point tracking versus
When I initially separated the first 87 trials by center and nose tracking I had no issues. However. When I try to give it multiple if statements it only gives me 2 of the outputs.
Cdata2=[ICCD ICCF ICCL ILCD ILCF ILCL IRCD IRCF IRCL IZLSD IZLSF IZLSL IZRSD IZRSF IZRSL];
Ndata2=[ICCD2 ICCF2 ICCL2 ILCD2 ILCF2 ILCL2 IRCD2 IRCF2 IRCL2 IZLSD2 IZLSF2 IZLSL2 IZRSD2 IZRSF2 IZRSL2];
BKGX=[{1:87};{88:174}];
f=1;
while f<=length(BKGX)
Cdata=Cdata2(BKGX{f},:)
Ndata=Ndata2(BKGX{f},:)
...
d=[{Cdata} ;{Ndata}];
e=1;
while e<=length(d);
SUMBDt=[d{e}];
...
if f==1 && e==1
SOC_Data_CenSBKG=ALLGEN';
elseif f==1 && e==2
SOC_Data_NosSBKG=ALLGEN';
elseif f==2 && e==1
SOC_Data_CenDBKG=ALLGEN';
elseif f==2 && e==2
SOC_Data_NosDBKG=ALLGEN';
e=e+1;
end
f=f+1
end
end
  1 Comment
Walter Roberson
Walter Roberson on 20 Feb 2014
Are you sure that e=e+1; should only be done in the case f==2 & e==2 ?

Answers (0)

Community Treasure Hunt

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

Start Hunting!