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.
Best Answer