Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のように始まる .m ファイルがあります。
function [] = foo(n);
foo(5)ユーザーがコマンド ウィンドウのように呼び出すと、問題ありません。fooしかし、ユーザーがn を入力せずに のように呼び出したときにも関数を実行したいと思います。array を使用して c++ でこれを処理しargv[]ますが、MATLAB でこれを行う方法はありますか?
foo(5)
foo
argv[]
御時間ありがとうございます..
使用narginして関連させることができます。
nargin