[Scilab-users] Redefined function does not remain redefined in macro

DominicErnst dominic.ernst at bystronic.com
Mon Jun 22 11:31:06 CEST 2015


Dear all,

I stumbled across a strange behavior I don't understand correctly.
Please also refer to the simplified code extract below.

Apparently beta(x,y) refers to a built in SciLab function (beta function
(Euler integral of the first kind)). If I redefine the function by a simple
vector variable, I obviously get the warning that the function was redefined
(funcprot(1)). Which is what I would expect.

Now, if I try to write-access a particular value in this now initialized
vector I get the Warning "Warning: obsolete use of '=' instead of '=='.". To
my understanding, this happens as scilab still interprets the function as
the default function beta and not the redefined vector.

Is there any way to circumvent this? Or am I forced to choose another
variable name?

Example code snippet:

clc;
clear;
funcprot(1);

b = 2;

p= linspace(0,20,10)';

beta= zeros(1:10)';

for i = 1:length(p)-1 do
    a(i)= b*cos(beta(i)/2);
    beta(i+1)= p(i+1)*a(i);
end

Any help is greatly appreciated

Best,

Dominic



-----
--
Dominic Ernst

CNC-PLC Software Developer @ Bystronic Laser AG
--
View this message in context: http://mailinglists.scilab.org/Redefined-function-does-not-remain-redefined-in-macro-tp4032484.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list