[Scilab-users] unexpected result

Stéphane Mottelet stephane.mottelet at utc.fr
Wed May 22 17:41:12 CEST 2019


Hello Paul,

B(i-1:$,1) in a rhs is evaluated as a temporary 6x1 vector when passed 
as an argument to find() and any reference w.r.t. B is of course disgarded.

The obtained result is the expected result.

S.

Le 22/05/2019 à 09:51, Carrico, Paul a écrit :
>
> Hi All,
>
> In the following code, I was thinking that the provided index was the 
> one on the “global” matrix, but I was wrong J
>
> (I guess a copy is performed first in order to be more efficient and 
> to speed-up the calculation)
>
> Paul
>
> n= 10;
>
> B= ones(n,1);
>
> i= 6;
>
> B(i,1)=0.55;
>
> a1= find(B(:,1) < 1); disp(a1);
>
> a2= find(B(i-1:$,1) < 1); disp(a2);
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20190522/a5f10285/attachment.htm>


More information about the users mailing list