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 中查找有关 String 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!