Effacer les filtres
Effacer les filtres

how i can have dimension input of a defined function like f ?

2 vues (au cours des 30 derniers jours)
xosro
xosro le 1 Juil 2015
i have a code that input of its a handle function like f, in duration of this code i need to number of input this function for example f is: f=@(x,y)(x+y)

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 1 Juil 2015
Modifié(e) : Azzi Abdelmalek le 1 Juil 2015
f=@(x,y)(x+y)
s=func2str(f);
a=regexp(s,'(?<=@\()[\w,]+(?=\))','match')
out=numel(cell2mat(regexp(a,'\w+')))

Plus de réponses (1)

Walter Roberson
Walter Roberson le 2 Juil 2015
f = @(x,y)(x+y)
out = nargin(f)

Catégories

En savoir plus sur Clocks and Timers dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by