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

 채택된 답변

Walter Roberson
Walter Roberson 2019년 4월 5일

1 개 추천

nargin(FunctionHandle)

댓글 수: 1

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개)

카테고리

도움말 센터File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품

릴리스

R2018b

질문:

2019년 4월 5일

댓글:

2019년 4월 5일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by