I have the need to call the SCILAB native ode function inside a user-defined function. But I find that this generates an error message.
For example, in the first example obtained by typing help ode, the script fails to execute if the ode function is called inside a user-defined function. Is there any solution to this problem
function ydot=f(t, y)
ydot=y^2-y*sin(t)+cos(t)
endfunction
y0=0;
t0=0;
t=0:0.1:%pi;
y = ode(y0, t0, t, f);
plot(t,y)
//This does not work if ode is called inside a user-defined function
function [yy]=myexample(y0, t01, t)
y = ode(y0, t0, t, f);
plot(t,y)
endfunction
[yy] = myexample(y0.t0, t);//this call list the error "Attempt to reference field of non-structure array".