data sharing between two GUI and with in a GUI
1 次查看(过去 30 天)
显示 更早的评论
hi everyone, i am using a main GUI and a sub GUI and i created them using GUIDE. i want to pass variables from the main GUI to sub GUI and i made it using setappdata and getappdata. the code is as shown below:
setappdata(0,'sampfreq',fs);
i am able to transfer the "fs" value to the sub GUI but in the sub GUI when i am using handles to share the data with in the second GUI it is showing the error as shown below.
code:
set(handles.pp_val,'string',num2str(m));
i am using this command to display some value in the static text box.
the error i am getting is :
?? Attempt to reference field of non-structure array.
Error in ==> tr4>pbacquire_Callback at 87 set(handles.pp_val,'string',num2str(m));
can any one please suggest me to get rid of the above stated problem. please help me as i am struggling with this problem from last two weeks. please help me, thanks in advance.
0 个评论
回答(1 个)
Fangjun Jiang
2011-7-15
Put a break point at this line and run your code, check what is the value of handles.pp_val, can you run the following command in the MATLAB command window:
get(handles.pp_val)
3 个评论
Walter Roberson
2011-7-15
That particular error would occur if handles was not a structure at all, so checking with get(handles.pp_val) would fail. class(handles) would show you what type of thing handles is.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!