how to return the value to workspace after user select item in pop-up menu
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
wenchao zhang
am 25 Mai 2024
Kommentiert: Stephen23
am 26 Mai 2024
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.
3 Kommentare
Stephen23
am 26 Mai 2024
define the output argument in the main function or in the callback function?"
From the main function.
Akzeptierte Antwort
Animesh
am 25 Mai 2024
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Graphics Objects finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!