how to return the value to workspace after user select item in pop-up menu
3 次查看(过去 30 天)
显示 更早的评论
hi, i want to return the value to workspace, when i select the specific item in pop-up menu, how to store it in the workspace.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1703691/image.png)
3 个评论
Stephen23
2024-5-26
define the output argument in the main function or in the callback function?"
From the main function.
采纳的回答
Animesh
2024-5-25
You can use the assignin function in MATLAB to save the selected value to the workspace.
Here's how you can do it:
assignin('base', 'selection', str{val});
With this, a variable named selection will be created in the workspace, containing the value of the selected item.
You can refer the following MathWorks documentation for more information on assignin function:
https://www.mathworks.com/help/releases/R2019a/matlab/ref/assignin.html
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!