입력인수가 부족합니다. 어떻게 해결해야할지 모르겠습니다.
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
function dy = ode(t,y)
dy = -y-5*exp(-t)*sin(5.*t);
0 commentaires
Réponses (1)
Hornett
le 31 Août 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.
0 commentaires
Voir également
Catégories
En savoir plus sur 상미분 방정식 dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!