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?
댓글 수: 0
채택된 답변
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 Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!