Problem with axes in GUI
4 views (last 30 days)
Show older comments
(sorry for my English)
I have problem with axes in my GUI. When I ran it for the first time - everything is OK, but for the second time (I want to plot some other data in the same axes) it throws error.
Reference to non-existent field 'axes2'.
Error in gui2>detekce_sweepy_5_progui (line 183) axes(handles.axes2);
My part of code:
handles = guihandles();
axes(handles.axes2);
plot(h);
So I donť know how to fix it... Thanks for advices!
2 Comments
Jan
on 18 Jan 2014
We do not see enough code for an educated guess of the underlying problem. Please use the debugger to find out more details.
Accepted Answer
Amit
on 19 Jan 2014
You will not get this issue if you remove handles = guihandles();
handles structure is available to all functions. in the section where you are trying this, axes(handles.axes2) will work without calling handles = guihandles().
Try simply
% handles = guihandles()
axes(handles.axes2);
plot(h);
I am not completely sure why axes2 gets removed from the handles structure after you execute the code the way you have done.
5 Comments
abhishek m
on 16 Mar 2018
im2=imread('sk.png'); bw = im2; bw = sum((1-im2).^2, 3) > .5; %bw = min( bw, [], 3 ) < 50 ; % dark pixels - intensity lower than 50 [y x] = find( bw ); % note that find returns row-col coordinates.
mx = mean(x); my = mean(y); C = [ mean( (x-mx).^2 ), mean( (x-mx).*(y-my) );... mean( (x-mx).*(y-my) ) mean( (y-my).^2 ) ]; [V D] = eig( C );
quiver( mx([1 1]), my([1 1]), (V(1,:)*D), (V(2,:)*D), .05 ); [~,mxi] = max(diag(D)); % find major axis index: largest eigen-value or = atan2( V(2,mxi), V(1,mxi) ) * 180/pi ; % convert to degrees for readability rotate = imrotate( im2, or-90 );
handles = guihandles();
axes(handles.axes2);
imshow( rotate );
set(handles.text3, 'String',or-180);
i am getting error in axes like "Reference to non-existent field 'axes2'" how to fix it>
More Answers (0)
See Also
Categories
Find more on Legend in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!