MATLAB: Assigning plot to an existing axes Matlab GUI

guidematlab guiplotting

Hi, I have a GUI in Matlab and several functions in it. One function is for plotting a figure, I need to assign it to an existing axes in GUI. I have tried several options, nothing has worked out yet.
Code below is the current option I had tried before I asked here.
set('CurrentAxes','axes11')
plot(VyQRS(:,2));
grid on
The plot of VyQRS I need to assign to axes11. Could you please give me any hint?

Best Answer

Try this:
axes(handles.axes11); % Switch current axes to axes11.
plot(VyQRS(:,2)); % Will plot into axes11.
grid on