입력인수가 부족합니다. 어떻게 해결해야할지 모르겠습니다.

4 views (last 30 days)
진욱 윤
진욱 윤 on 24 Jul 2022
Answered: Hornett on 31 Aug 2023
function dy = ode(t,y)
dy = -y-5*exp(-t)*sin(5.*t);

Answers (1)

Hornett
Hornett on 31 Aug 2023
질문에 대한 답변은 영어로 제공됩니다. 명확하지 않은 경우 알려주시면 귀하의 언어로 답변을 공유해 드리겠습니다.
I understand that you are trying to call the function you have created in MATLAB.
function dy = ode(t,y)
dy = -y-5*exp(-t)*sin(5.*t);
end
The function defines 2 input arguments (t and y). When you run “ode”, you must specify exactly two inputs, otherwise you will get the error "Not enough input arguments".
For example, if you run the “ode” in the command window without specifying any arguments:
ode
You get this error:
Not enough input arguments.
If you have the file "ode.m" open in the Editor and you try to run the function by pressing the "Run" button or F5, MATLAB runs the “ode” without any input arguments, and you get the error "Not enough input arguments". The "Run" button dropdown menu then opens prompting you to enter values for the missing input arguments.
Add the desired values and press enter. The values you enter are set as the default inputs when you click the "Run" button or F5 in the future.
To change the values, press the down arrow below the "Run" button and enter new values.

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!