I am using an example pulled directly from ode45 documentation.
tspan = [0 5];
y0 = 0;
[t,y] = ode45(@(t,y) 2*t, tspan, y0);
results in:
Error using ode45
Too many input arguments.
I've been trying to solve a system of differential equations using ode45. I'm not sure if this is a software bug or something, but ode45 continues to result in too many arguments. The code above is copied directly from ode45 documentation. Similarly, when I use a different example pulled directly from https://www.mathworks.com/help/matlab/ref/ode45.html
I get:
pic1.png
pic2.png

1 件のコメント

Stephen23
Stephen23 2018 年 12 月 5 日
編集済み: Stephen23 2018 年 12 月 5 日
It sounds as if you have defined your own ode45 function, which is shaodowing the inbuilt one. Please show us the output of this command:
which ode45 -all

サインインしてコメントする。

 採用された回答

madhan ravi
madhan ravi 2018 年 12 月 5 日
編集済み: madhan ravi 2018 年 12 月 5 日

0 投票

Everything seems to be correct assuming that you saved the function properly with the correct name.
The right usage of the given example:(function should be below the code - meaning at the end of the script file or saved as a function file with the name of the function)

その他の回答 (0 件)

カテゴリ

質問済み:

2018 年 12 月 5 日

編集済み:

2018 年 12 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by