From: Matt Fig on 12 Dec 2009 16:18 You need to make the axes current before the plot, or pass the handle to the axes to the plot function itself. So if you create all the axes, then call a function to do the plotting, you should also pass the axes handles (or access them in some other way).
From: Jane on 12 Dec 2009 16:30 "Matt Fig" <spamanon(a)yahoo.com> wrote in message <hg11am$cml$1(a)fred.mathworks.com>... > You need to make the axes current before the plot, or pass the handle to the axes to the plot function itself. So if you create all the axes, then call a function to do the plotting, you should also pass the axes handles (or access them in some other way). All my handles are in a structure called h, which I have made global. For each plot I use the code: for hn = 1:6 hs = myfunc(x,y,z); axes(h.(['harmonic',num2str(hn)])); plot(t,hs,'b') end This works fine when the function is provoked using the callback of a puchbutton but doesn't work when I provoke it after running all the code to initialise all of the textboxes, buttons, axes etc. Even though when I put a break in the code I can see that the handles do exist.
From: Jan Simon on 12 Dec 2009 17:35 Dear Jane! > The problem I'm having is that it is taking the gui an age to initialise. If you set the Visibility of the figure to 'off' initially, Matlab does not waste time with rendering until the gui is finished. Then finally enable the visibility again. --- At least this helped in the historical Matlab 6.5... Another acceleration might be P-coding the functions (help pcode). This helps if the first time creation of the gui in a Matlab session takes significantly more time than subsequent calls. Good luck, Jan
From: Jane on 12 Dec 2009 18:00 "Jan Simon" <matlab.THIS_YEAR(a)nMINUSsimon.de> wrote in message <hg15qo$gor$1(a)fred.mathworks.com>... > Dear Jane! > > > The problem I'm having is that it is taking the gui an age to initialise. > > If you set the Visibility of the figure to 'off' initially, Matlab does not waste time with rendering until the gui is finished. Then finally enable the visibility again. > --- At least this helped in the historical Matlab 6.5... > > Another acceleration might be P-coding the functions (help pcode). This helps if the first time creation of the gui in a Matlab session takes significantly more time than subsequent calls. > > Good luck, Jan I've not heard of p-code before, but from a quick read I don't think it's relevant as I've used nested functions. Turning the visibilty off though worked a treat. .... Now if I could just get my initial data to plot!
From: Matt Fig on 12 Dec 2009 18:54 pcode has nothing to do with nested functions. It is difficult to tell what is going wrong with your code from here. Did you try to put a DRAWNOW before the plotting function is called on initialization? Why are you using both GLOBAL variables and nested functions in one file? If you can't get it working, you can email it to me and I will look it over.
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: simulated ARMA model output Next: line scan along x direction of mesh plot |