Initializing variables
Ben Abbott
bpabbott at mac.com
Fri Jun 20 19:53:06 CDT 2008
On Jun 20, 2008, at 8:06 PM, asha g wrote:
> I have a program with several variables - all are vectors or matrices.
>
> Now do I initialize the ones I need to save and plot at the
> beginning of the program or all the variables that are used in the
> program?
> eg - if I need vvvv and abhh do I just write:
>
> vvvv= zeros(niter, N); abhh = zeros(niter,N);
>
> before the start of the script file or shd I do that to each one of
> them. When niter is large and N is large, this takes up lots of
> space and slows down operations. However, when I don't do it to all
> the variables I am not sure what is going on especially as there are
> many loops inside.
>
> I hope this is clear.
> Thanks
> Asha
I recommend you initialize all arrays (vectors and matrices).
Ben
More information about the Help-octave
mailing list