plot does not support the list(f,a) syntax for callbacks.
Reported by Michael BAUDIN
-- Bug description --
plot does not support the list(f,a) syntax for callbacks.
Many algorithms take functions as input arguments, e.g. fsolve, optim, ode, etc... In the case where the function requires more input arguments, we have the possibility to pass to, say fsolve, a list made of the actual function, followed by the arguments. This allows to write cleaner scripts, where the arguments are not passed by the scope.
But the plot function does not have this feature, so that the test script does not work.
Obviously, there is the following workaround:
y = f(x,a);
plot ( x , y )
Still, the Scilab API should be uniform across the functions.
-- Scilab error message --
-- How to reproduce the bug --
function y = f ( x , a )
y = a * x.^2
endfunction
x = linspace ( 0 , 1 , 100 );
a = 2
plot ( x , list ( f , a ) )