Bug in Octave (and MatLab?)
Folks,
Try this code:
%%% bug?
fprintf("\ntest of if & vector:\n")
for i = 1:5
fprintf("inside loop with index = %3.0f\n",i)
if i=2:3
fprintf("test true... %3.0f\n",i)
end
end
fprintf("completed loop with index= %3.0f\n",i)
%%%
No only does it not give an error for the if statement/assignment statement AND it treats the if test as true (consistent with non-zero evaluation result of the if statement, ok), it ALSO prints the line outside the loop twice???
1
vote
Anonymous
shared this idea