call a function with the namefunction in a variable

1 Ansicht (letzte 30 Tage)
marilia15
marilia15 am 10 Apr. 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

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by