From: dpb on 9 Apr 2010 14:59 Dave ba wrote: > dpb, It is finally working!! I did got help from my mentor. > with the code of the thread: Plotting gone wrong. (message 12) > > first push button: > Y=zeros(1,t); instead of: Y=zeros(1,length(t)); <-- because with this > one it says how many value's a variable has, instead of using the real > value. this time the value of t was 32, but with 'length' it says 32 is > only 1 number, so it gets the value 1. My bad there, sorry...didn't catch that t wasn't the vector of t's at that point; just assumed it was. > setappdata(gcf,'Y',Y) > .... > Y = getappdata(gcf,'Y'); <-- if it was Y(1,t) =... it gets erased again. > You were right that whole time. .... Hmmm....so appdata _can_ be an array as initially supposed it could. Makes sense, but now I'll have to back and reread the R2009 documentation that seems to belie that and see if can decipher what it was in reference to... > thanks again dpb, you've helped me this whole time. even though you say > you dont use guide, I would put guide-master behind your name if it was > up to me. Well, not really...I just read the doc's and used what little I could ken from the way ML otherwise behaves... Glad you (or your mentor, anyway) found the 'gotcha' -- I'd gone past that point other than knowing that somewhere you did need to create the array in the initialization code. -- |