assign string to handles structure
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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
0 Commenti
Risposta accettata
Adam
il 22 Set 2014
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.
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!