Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

How to summon a function that it's name was stored in a string?

Asked by pouya jamali on 23 Oct 2011

During my program ,I want to summon a function that it's name was previously saved in a string variable ! How can I do it?

0 Comments

pouya jamali

Products

No products are associated with this question.

1 Answer

Answer by Walter Roberson on 23 Oct 2011
Accepted answer

It is better to avoid doing such things if you can. Consider instead storing function handles, or using str2func.

What you are asking for is possible (and not syntactically difficult), but it gets misused much much more often than it gets used properly.

1 Comment

pouya jamali on 23 Oct 2011

Thank you Walter

Walter Roberson

Contact us