Pass data from figure to main GUIDE pushbutton callback function

1 visualización (últimos 30 días)
I created a pushbutton in main gui using guide and also programmatically created a figure with pushbutton which inputs data. How can I pass the data when the pushbutton is press from the figure and send it to the main gui pushbutton callback function? I have attached an image for clarification.

Respuesta aceptada

KL
KL el 20 de Nov. de 2017
Editada: KL el 20 de Nov. de 2017
You need to update the hObject handle using,
guidata(hObject,handles);
Upon edit, save the new table data in this handle,
hObject.TableData = get(uitableHandle,'Data');
and then in the pushbutton callback use it like,
plot(hObject.TableData)
  3 comentarios
KL
KL el 20 de Nov. de 2017
After you update the derated table (be it anywhere), do
hObject.deratedData = derated.Data;
guidata(hObject,handles);
Now your changes are updated to the structure. Now when you are inside your main paushbutton callback, retrieve it like,
dataToPlot = hObject.deratedData;
Kim Lopez
Kim Lopez el 20 de Nov. de 2017
Wow, that works well. Thank you so much.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by