How to share a variable between gui?
显示 更早的评论
Hello.
I am having a problem trying to share a matrix between a table and a plot in GUI. This matrix is edited with the table and determines the offset of the graphs ploted. The code is below and I need to pass "plotset" between the three functions. Plot set is made in update_xrddata, and then eddited in a table in function data_table_CellEditCallback. After which its read in function update_Callback in order to plot data with required parameters. I have tried guidata, setappdata functions but could not get them to work. Any help is appreciated. Thank you.
function update_xrddata(handles)
plotset=[plotname datasets offset];
set(handles.data_table,'Data',plotset)
function update_Callback(hObject, eventdata, handles)
j=plotset(i,2);
function data_table_CellEditCallback(hObject, eventdata, handles)
plotset= get(handles.data_table, 'data')
1 个评论
Image Analyst
2012-5-28
How can this work? You don't have anything defined for datasets or offset. Show your setappdata() and getappdata() calls. That should work so you must have done something wrong with it.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!