Number of input parameters of a function.
1 回表示 (過去 30 日間)
古いコメントを表示
If you have a function's handle,
Is there any way to figure out how many input parameters it expects in the function's signature?
Even ugly hacky ways are fine.
-Milad
0 件のコメント
採用された回答
Walter Roberson
2019 年 4 月 5 日
nargin(FunctionHandle)
1 件のコメント
John D'Errico
2019 年 4 月 5 日
A good way to learn this would have worked is to use methods. For example:
H = @(x,y) x+y
H =
function_handle with value:
@(x,y)x+y
>> methods(H)
Methods for class function_handle:
display func2str functions nargin nargout
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!