Pass data from figure to main GUIDE pushbutton callback function
1 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
KL
2017-11-20
编辑:KL
2017-11-20
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 个评论
KL
2017-11-20
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;
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!