How do I save the value of checkboxes to plot only the selected in another function in Guide?

I have some checkboxes and I want to plot only data that is selected. My problem is to get the information if the checkboxes are selected or not. Using Guide.

 Réponse acceptée

You can use
checkboxValue = get(handles.checkBox1, 'Value');
No need to cast to double, and don't use hObject. This will work in ANY callback function, not just the callback of the checkbox itself, but also the callback of any other control (buttons, etc.) as long as you don't use hObject. If you need to get the checkbox value in other functions (non-callback functions), such as those you wrote, the easiest thing to do is to just pass handles into those functions. Otherwise you can check out the FAQ for harder ways: http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F

Plus de réponses (0)

Catégories

En savoir plus sur Graphics Object Properties dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by