[scilab-Users] Difference in calculations between Matlab and Scilab

Yann Collette yann.collette at scilab.org
Wed Nov 11 16:59:35 CET 2009


Hello,

Classical mistake:

Try

(1)./X

the . under matlab has not the same priority as the scilab one.

YC

Sébastien Bihorel a écrit :
> Hi
>
> I would be interested knowing why Scilab (version beta 5.2) and Matlab 
> (7.6.0) do not provide the same results for a '1/x' calculation (with 
> x being a matrix of real numbers), and how to reproduce the results of 
> Matlab in Scilab for this particular case.
>
> Thank you
>
> Sebastien
>
> %%%%%%Matlab
>
> >> X=1:5
>
> X =
>
>      1     2     3     4     5
>
> >> 1./X
>
> ans =
>
>     1.0000    0.5000    0.3333    0.2500    0.2000
>
>
> /////////////// Scilab
>
> -->X=1:5
>  X  =
>  
>     1.    2.    3.    4.    5. 
>  
> -->1./X
>  ans  =
>  
>     0.0181818 
>     0.0363636 
>     0.0545455 
>     0.0727273 
>     0.0909091




More information about the users mailing list