Problem with axes in GUI
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ondrej
el 18 de En. de 2014
Comentada: abhishek m
el 16 de Mzo. de 2018
(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 comentarios
Jan
el 18 de En. de 2014
We do not see enough code for an educated guess of the underlying problem. Please use the debugger to find out more details.
Respuesta aceptada
Amit
el 19 de En. de 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 comentarios
abhishek m
el 16 de Mzo. de 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>
Más respuestas (0)
Ver también
Categorías
Más información sobre Graphics Object Properties en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!