if statement of type cell problem..
Show older comments
It seems an easy problem but I just can't figure it out.
let A,B,C be vectors.
for i=1:100
if A(i)<B(i)
C(i)=0;
else
C(i)=1;
end
end
this code, of course, works well. but if I define, say D={A(i)<B(i)} and
for i=1:100
if D{1}==1
C(i)=0;
else
C(i)=1;
end
end
This code does not work. Looks like some kind of data type problem, but I just don't know how to fix it. Thanks in advance.
Accepted Answer
More Answers (0)
Categories
Find more on Communications Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!