On 21-Jun-2007, Muthiah Annamalai wrote:
| Hello there,
|
| I wanted to ask if there is a difference between writing a program like
|
| for x=linspace(-pi:+pi,Npts)
| [X,Y,Z,L,M,N]=init_variables();
| do_a_time_consuming_long_computation();
|
| %clear the memory used
|
| clear all
| end
|
| % and this function?
|
| for x=linspace(-pi:+pi,Npts)
| [X,Y,Z,L,M,N]=init_variables();
| do_a_time_consuming_long_computation();
| end
|
|
| My advisor told me, it saves something and does better in long programs.
| Thanks in advance.
Doing "clear all" also clears all function definitions, so they will
have to be reloaded the next time through the loop (which will also
cause any persistent variables to be reinitialized). In Matlab, "clear
all" also deletes debugging breakpoints. Is that the effect you
really want?
jwe