Problem with axes in GUI
5 次查看(过去 30 天)
显示 更早的评论
(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 个评论
Jan
2014-1-18
We do not see enough code for an educated guess of the underlying problem. Please use the debugger to find out more details.
采纳的回答
Amit
2014-1-19
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 个评论
abhishek m
2018-3-16
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>
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Legend 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!