Input argument "M" is undefined.
10 ビュー (過去 30 日間)
古いコメントを表示
function theta=fireApp(M,delta,stepnum)
%Create the Matrix A with M steps for high delta
%Parameter
lamda=0.103;
r=80;
W=1;
Q0=7.1e017;
Ta=16220;
thetaPress=473.15;
b=Ta/thetaPress^2;
K=Q0*W*exp(-2*Ta/thetaPress)/lamda;
%step size
h=1/(M-1);
I ended up having this error at the last line:
??? Input argument "M" is undefined.
Error in ==> fireApp at 13
h=1/(M-1);
Can anyone help me make sense of this error?
0 件のコメント
回答 (2 件)
Andreas Goser
2016 年 2 月 15 日
Can you tell us how you call the function?
That likely happens when you try to run this from the editor where this file is open. But it is a function and you need to call it with parameters so that "M" is known.
0 件のコメント
Walter Roberson
2016 年 2 月 15 日
You cannot run this code by going to the MATLAB menu and requesting that it be executed, or by pushing one of the F5 of F12 buttons. You must go to the MATLAB command line and give the command name and pass in values for the three arguments. For example,
result = fireApp(172, 0.52347, 88);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Entering Commands についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!