|
I have a gui (created with GUIDE) that contains a "Go" pushbutton and several axes.
Upon pushbutton down, I want to run a second function that collects some data from an external device and plots that data in the axes within the GUI. I want this plotting to happen while the second function is still running to see the data as it is collected. Depending on when the data is collected, it should be targeted to a specific axes within the GUI.
Not sure I'm going about this the correct way at all but I tried to make the GUI handles variable global in both functions and plot within the second function by making the desired axis current with the approriate axis handle....as follows:
global handles
axes(handles.axes1) % make axes1, for example, current
plot(x, y) %plot in the current axis
....but it seems the handle is not recognized as such when called in the second function, as I get the error
Error using ==> axes
Invalid object handle
Can anyone help me on where I am going wrong with this approach or whether I should use a different tack like nesting the function in the GUI?
Thanks a lot
Mike
|