Problem with axes in GUI
조회 수: 9 (최근 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에서 Graphics Object Properties에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!