Script nested_if.m
Download Script nested_if.m
a=5; b=1:5;

j=1;
if a==b(5)
c(1,j)=1
j=j+1

if a==b(5)
c(1,j)=2
j=j+1

if a==b(5)
c(1,j)=3
j=j+1

if a==b(5)
c(1,j)=4
j=j+1
end
end
end
end
c
whos c

Back