Number of input parameters of a function.

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

 Respuesta aceptada

Walter Roberson
Walter Roberson el 5 de Abr. de 2019
nargin(FunctionHandle)

1 comentario

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Productos

Versión

R2018b

Etiquetas

Preguntada:

el 5 de Abr. de 2019

Comentada:

el 5 de Abr. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by