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
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.

댓글을 달려면 로그인하십시오.

 채택된 답변

Walter Roberson
Walter Roberson 2012년 5월 28일

0 개 추천

댓글 수: 3

Alex
Alex 2012년 5월 28일
Thanks that was more clear then the matlab website. Now to figure out how to clear the plot window.
Walter Roberson
Walter Roberson 2012년 5월 28일
cla() to clear the axes.
Image Analyst
Image Analyst 2012년 5월 28일
But the FAQ just tells you to use getappdata/setappdata which you said you had tried unsuccessfully. That's why I didn't recommend the FAQ to you and asked you to show your code.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Graphics Performance에 대해 자세히 알아보기

질문:

2012년 5월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by