assign string to handles structure

2 ビュー (過去 30 日間)
Jason
Jason 2014 年 9 月 22 日
コメント済み: Jason 2014 年 9 月 22 日
Is there a reason why the following is throwing an error ( Undefined function or variable 'hobject'.
Error in Montage>pushbutton1_Callback (line 149) handles.LString=legString;)
obj=get(handles.uipanelColour,'SelectedObject');
strC=get(obj,'Tag')
ImageFiles = dir([folder '\*red.tif*']);
switch strC
case 'rbRed'
ImageFiles = dir([folder '\*red.tif*']);
legString='Red';
case 'rbGreen'
ImageFiles = dir([folder '\*green.tif*']);
legString='Green';
end
%Assign legend String to handles structure so get later
handles.LString=legString;
guidate(hobject,handles); %Update gui handles structure

採用された回答

Adam
Adam 2014 年 9 月 22 日
Depending whether you pasted that code in to the question box or just typed it out there are two typos on the final line. If you pasted directly from your code these are likely your problem:
guidate(hobject,handles);
should read
guidata(hObject,handles);
instead.
I would have thought it would throw an error on guidate, but I guess evaluation of the arguments throws its error before the function/variable 'guidate' not existing.
  1 件のコメント
Jason
Jason 2014 年 9 月 22 日
Thanks Adam.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by