Samuel,
I haven't used ode(), but I don't think the problem is related to the solver itself. I notice that your variable is t01 while you are calling ode() with t0 instead of t01 as one of the arguments in your function myexample(). Besides, when you actually call myexample(), you mistakenly use a "." instead of a "," and that's why Scilab believes it is a field of some non existent structure and yields the error code. Regards, Federico Miyara On 25/9/2025 09:39, Samuel Enibe wrote: 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". Samuel Enibe University of Nigeria, Nsukka, Nigeria This email and any attachments are intended solely for the use of the individual or entity to whom it is addressed and may be confidential and/or privileged. If you are not one of the named recipients or have received this email in error, (i) you should not read, disclose, or copy it, (ii) please notify sender of your receipt by reply email and delete this email and all attachments, (iii) Dassault Systèmes does not accept or assume any liability or responsibility for any use of or reliance on this email. Please be informed that your personal data are processed according to our data privacy policy as described on our website. Should you have any questions related to personal data protection, please contact 3DS Data Protection Officer https://www.3ds.com/privacy-policy/contact/ _______________________________________________ users mailing list - [email protected]<mailto:[email protected]> Click here to unsubscribe: <mailto:[email protected]><mailto:[email protected]> https://lists.scilab.org/mailman/listinfo/users [https://s-install.avcdn.net/ipm/preview/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> Libre de virus.www.avast.com<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> This email and any attachments are intended solely for the use of the individual or entity to whom it is addressed and may be confidential and/or privileged. If you are not one of the named recipients or have received this email in error, (i) you should not read, disclose, or copy it, (ii) please notify sender of your receipt by reply email and delete this email and all attachments, (iii) Dassault Systèmes does not accept or assume any liability or responsibility for any use of or reliance on this email. Please be informed that your personal data are processed according to our data privacy policy as described on our website. Should you have any questions related to personal data protection, please contact 3DS Data Protection Officer https://www.3ds.com/privacy-policy/contact/
_______________________________________________ users mailing list - [email protected] Click here to unsubscribe: <mailto:[email protected]> https://lists.scilab.org/mailman/listinfo/users
