call a function with the namefunction in a variable

1 view (last 30 days)
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

Accepted Answer

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

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!