From: TideMan on 18 Feb 2010 20:43 On Feb 19, 2:08 pm, AMK <kennas...(a)gmail.com> wrote: > So obviously that will work, but I didn't know you couldn't (or the reason why)you can't clear workspace variables from within a function. Well, of course. They only exist in the function where you created them. This seems patently obvious to me. It seems that you lack a basic understanding of how functions work. Maybe you need to find a good textbook and read up about all this.
From: ImageAnalyst on 18 Feb 2010 21:24 On Feb 18, 8:08 pm, AMK <kennas...(a)gmail.com> wrote: > So obviously that will work, but I didn't know you couldn't (or the reason why)you can't clear workspace variables from within a function. ---------------------------------------- It will work if both of your m-files are just simple scripts - no line in them that says "function foo()" or whatever. Otherwise the variables live only inside the function and only when the function is actually executing, and other functions can't (normally) see other functions' variables.
From: AMK on 18 Feb 2010 11:33 You're right, my matlab library consists of a vast array of "scripts". Horrible coding habit.
From: AMK on 18 Feb 2010 11:40 Typically, all I write are scrips and not function foos(). Thus, with my first actual well functioning function foo(), I was surprised to see this behavior. Thanks - I'm reading now.
First
|
Prev
|
Pages: 1 2 Prev: Not enough memory to render a 1217 by 0 buffer Next: Reinterpreting float32 data as uint32 |