[Scilab-users] Ways to speed up simple things in Scilab ?

Samuel Gougeon sgougeon at free.fr
Fri Apr 24 15:57:13 CEST 2015


Le 24/04/2015 15:35, Samuel Gougeon a écrit :
> .../...
> The test:
> A  =  sign(sprand(839,172,2/172,  "normal"));
Sorry for this bad mixing between an unworkable line and its workaround.
Dropping sign() on the first line is OK for a copy/past:
> A  =  sprand(839,172,2/172,  "normal");
> i  =  A>0;  A(i)  =  1;
> i  =  A<0;  A(i)  =  -1;
> p  =  rand(172,1);
> tic()
> for  i  =  1:1000
>      M1_v  =  A*p;
> end
> toc()
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20150424/877f40ec/attachment.htm>


More information about the users mailing list