plotting at gui axes
Mostrar comentarios más antiguos
let me explain my problem clearly
I have a script file which contains a certain function which plotting a data at different times and save the output figures as pictures (.jpg) in a certain directory
but when a call this script from the gui (callbacks).m file something weird happen
while my script running when I click at the gui window the plot start to appear at gui axes and not at the figure which cause to save the same figure many times
because the new plot start to show at gui axes and not at figure
is there is any solution for this complex problem
here is my code for more understanding
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f=figure;
i=0;
t=zeros(1,75);
o=t;
a=t;
v=t;
for t_instantaneous=0:0.04:4.96
i=i+1;
[theta_instantaneous,omega_instantaneous,alpha_c,t_v_m_instantaneous]=raafawcaa06([0,0],4,-pi/3,-3,1,t_instantaneous);
t(1,i)=theta_instantaneous;
o(1,i)=omega_instantaneous;
a(1,i)=alpha_c;
v(1,i)=t_v_m_instantaneous;
axis([-10,10,-10,10])
pbaspect([1,1,1])
saveas(f,sprintf('pic%06d',i),'jpg')
hold off
end
close(f)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 comentarios
Geoff Hayes
el 5 de Mzo. de 2020
Osama - is the above code from your script? And you call this script from a (GUI) function callback? I'm not all that clear on your statement while my script running when I click at the gui window the plot start to appear at gui axes and not at the figure which cause to save the same figure many times. Do you mean that the GUI is running and you click a button in the GUI which then calls your script? And that the plot appears on the GUI rather than in the new figure? Please clarify.
Osama Alkurdi
el 5 de Mzo. de 2020
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Interactive Control and Callbacks en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!