call a function with the namefunction in a variable

1 vue (au cours des 30 derniers jours)
marilia15
marilia15 le 10 Avr 2012
I can't find how to do it. I have the name of a function in a variable:
  • a='namefunction';
I want to call the function doing something like:
  • call(a, parameters)
Is it possible? Thanks

Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 10 Avr 2012
doc feval
doc eval
eg
a = 'size';
[s1 s2] = feval(a,[1 2 3])
  1 commentaire
marilia15
marilia15 le 10 Avr 2012
sorry for the easy question :)
thanks a lot

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by