[Scilab-users] Matlab to Scilab code query

Rafael Guerra jrafaelbguerra at hotmail.com
Tue Jul 17 21:01:13 CEST 2018


Actually, the root problem is not in Matlab fliplr(A) being replaced by A(:,$:-1:1), as per Scilab help file.
According to Matlab help:
“If A is a row vector, then fliplr(A) returns a vector of the same length with the order of its elements reversed. If A is a column vector, then fliplr(A) returns A. unchanged.”

The root problem was that the two vectors below in your script were considered row vectors by Octave and column vectors by Scilab.

Regards,
Rafael

From: users [mailto:users-bounces at lists.scilab.org] On Behalf Of Rafael Guerra
Sent: Tuesday, July 17, 2018 4:08 PM
To: Users mailing list for Scilab <users at lists.scilab.org>
Subject: Re: [Scilab-users] Matlab to Scilab code query

Hi Lester,

Your problem seems to be fixed by defining in Scilab:

//sl = fliplr(sl);
sl = sl($:-1:1); // Scilab reverse

//Wd = fliplr(Wd);
Wd = Wd($:-1:1); // Scilab reverse

For vectors, the L-R flip should be instead reverse order.

Regarding the massive time savings of Scilab 6 vs Octave, I see it on the first time the code is run but not afterwards.
Did not test enough.

Regards,
Rafael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20180717/7bbf45f4/attachment.htm>


More information about the users mailing list