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

조회 수: 1 (최근 30일)
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?

채택된 답변

Walter Roberson
Walter Roberson 2011년 10월 23일
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by