Error "Attempt to execute SCRIPT ode113 as a function" in MTLAB R2014a

Hello everyone,
I've tried to solve an ode problem with ode113 in MATLAB R2014a as follows:
clear all;
tspan = [0 5];
y0 = 0;
[t,y] = ode113(@(t,y) 2*t, tspan, y0);
plot(t,y,'-o')
but there's an error as "Attempt to execute SCRIPT ode113 as a function" and
Error in filename (line 4)
[t,y] = ode113(@(t,y) 2*t, tspan, y0);
I was wondering if somebody could help me about my problem.
Thanks in advance.

 Respuesta aceptada

Star Strider
Star Strider el 7 de Oct. de 2020
You have a script that you saved as ode113.m.
You need to rename it to something like ode113_file.m or something that makes sense in the context.

2 comentarios

It works properly now. Thank you so much.
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Programming en Centro de ayuda y File Exchange.

Productos

Versión

R2014a

Etiquetas

Preguntada:

el 7 de Oct. de 2020

Comentada:

el 7 de Oct. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by