Scilab got me there :D Thanks for the tip... I actually found a fix using ones(1,size(X,2) instead of 1, but, now, realize why this fixed the problem.<br><br><div class="gmail_quote">On Wed, Nov 11, 2009 at 10:59 AM, Yann Collette <span dir="ltr"><<a href="mailto:yann.collette@scilab.org">yann.collette@scilab.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello,<br>
<br>
Classical mistake:<br>
<br>
Try<br>
<br>
(1)./X<br>
<br>
the . under matlab has not the same priority as the scilab one.<br>
<br>
YC<br>
<br>
Sébastien Bihorel a écrit :<div><div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi<br>
<br>
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.<br>
<br>
Thank you<br>
<br>
Sebastien<br>
<br>
%%%%%%Matlab<br>
<br>
>> X=1:5<br>
<br>
X =<br>
<br>
1 2 3 4 5<br>
<br>
>> 1./X<br>
<br>
ans =<br>
<br>
1.0000 0.5000 0.3333 0.2500 0.2000<br>
<br>
<br>
/////////////// Scilab<br>
<br>
-->X=1:5<br>
X =<br>
1. 2. 3. 4. 5. -->1./X<br>
ans =<br>
0.0181818 0.0363636 0.0545455 0.0727273 0.0909091<br>
</blockquote>
<br>
</div></div></blockquote></div><br>