Need help with my function
古いコメントを表示
How can I input my own function? I type function [dist,vel,acc]= free_fall(t)or anything just involving the word function and receive an error message reading "FUNCTION keyword use is invalid here. This might cause later messages about END". I save the function as the script. Can not seem to figure it out.
採用された回答
その他の回答 (1 件)
David Sanchez
2013 年 7 月 29 日
function [dist,vel,acc]= free_fall(t)
% The code of your function here
...
...
% no need of adding "end"
2 件のコメント
Richard
2013 年 7 月 29 日
David Sanchez
2013 年 7 月 29 日
did you place your function in its own m-file, I mean, no any other code before the function declaration? Your error message is received when that is done. Functions has to be save in their own m-file.
カテゴリ
ヘルプ センター および File Exchange で Whos についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!