data sharing Between two GUIs

1 次查看(过去 30 天)
phani
phani 2011-5-26
hi everyone. i am using one main GUI and sub GUI. i want to share the variable in main GUI to sub GUI, for that i am using setappdata and getappdata. in my sub GUI i have two axes. when i am using handles to specify the axes to plot the data.i am getting error as shown below. command: plot(handles.time_axes,x,y);
error:
??? Attempt to reference field of non-structure array.
even when i am suing the following command set(handles.pp_value,'string',num2str(m)) i am having the same error.
please some one help me. can we use both handles and appdata in a GUI. please let me know where i am committing the mistake.
  2 个评论
Jarrod Rivituso
Jarrod Rivituso 2011-5-26
Could you post a snippet of your code so people can see a little more of what you are trying to do?
phani
phani 2011-5-27
basically i am trying to acquire data from DAC. so in my girst GUI i will set the samapling frequency[fs] and no of samples [N] in two variables. i want to use those two variables in the sub GUI as shown below.
load('d1.mat');
N=getappdata(0,'N')
y=d(1:N,1);
m=max(y);
set(handles.pp_value,'string',num2str(m));
when i am using this command :set(handles.pp_value,'string',num2str(m));
it is showing the error "??? Attempt to reference field of non-structure array."
and i created two axes in the sub GUI i want to plot a particular two values in a particular GUI so i used the command:
plot(handles.time_axes,x,y);
on execution the error i same. can we use both appdata and hadles structures in a same GUI. if not how to set a value in a static text box and draw a plot in a particular axis using appdata. or can we use handles structure only to share data between main and sub GUI. any type of help is accepted.
thank you.

请先登录,再进行评论。

回答(1 个)

Doug Hull
Doug Hull 2011-5-27
Watch this video about data passing in GUI design in MATLAB.

类别

Help CenterFile Exchange 中查找有关 Language Fundamentals 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by