GUIDE and selecting functions to apply on data
1 次查看(过去 30 天)
显示 更早的评论
I need to make a GUI in which different functions can be selected from a pop-down menu to work with data already loaded into the workspace. I just need to know the syntax in the m file for the gui:
if (function name) in list is selected
use this function
Apologies, this is a basic question, I have tried looking it up for a while and couldn't find anything. Thanks
0 个评论
采纳的回答
更多回答(1 个)
Jan
2013-3-16
List = {'sin', 'cos', 'tan'}; % String of the listbox
Value = 2; % Value property of the listbox
Selected = List{Value};
Data = 1.1415; % "data already loaded into the workspace"
result = feval(Selected, Data)
3 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!