Hello Erhy,

Le 24/03/2017 à 20:36, Erhy a écrit :
Hello!
Again a basic question.
e.g.
A =  [ 1 2 3 ];
I = find( A > 10);
if length(I) > 0 then
        I = I + 1;
end

Is there a alternative
*without the if ?*

Yes, just:
I = I + 1
The if is useless:

1. length(I)==0 means I==[] and then I+1 == []+1 ==[]  as if nothing
   was done
2. otherwise, just add 1

I miss the .+ operator.

So do i, sometimes.

Samuel

_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

Reply via email to