call a function with the namefunction in a variable

1 visualización (últimos 30 días)
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

Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 10 de Abr. de 2012
doc feval
doc eval
eg
a = 'size';
[s1 s2] = feval(a,[1 2 3])

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by