How to define a function
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
Why is my code giving the following error?
function da = alc_conc(t,a)
k0 = 0.04;
k1 = 0.02;
S = a(1);
B = a(2);
L = a(3);
da = [-k0*S
(k0*S)-(k1*B)
k1*B]
end
function da = alc_conc(t,a)
↑
Error: Function definitions are not permitted in this context.
0 件のコメント
回答 (1 件)
John D'Errico
2017 年 10 月 31 日
0 投票
Are you trying to type this in at the command line? You cannot do that. Use the editor. Save the function as an m-file, on your search path. Do NOT save it into the MATLAB directories as supplied by MathWorks.
0 件のコメント
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!