Use and update value from GUI

4 ビュー (過去 30 日間)
Guillermo Perez
Guillermo Perez 2017 年 1 月 29 日
回答済み: Image Analyst 2017 年 1 月 29 日
How do I get user input in a GUI for a variable and use it in another function. I need to run an algorithm where the user changes a variable value during run time.

回答 (1 件)

Image Analyst
Image Analyst 2017 年 1 月 29 日
Put a control on the GUI that will get the user input. This control could take the form of a edit text box, a slider, a popup menu, a listbox, a checkbox, or whatever you want. To get the values from any function or callback function that has access to handles, do this:
userValue = handles.slider1.Value;
userValue = handles.popup1.Value;
userValue = handles.editText1.String;
userValue = handles.checkbox1.Value;
userValue = handles.listbox1.Value;

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by