Does repeated use of ngrid suck up memory?

1 次查看(过去 30 天)
I calculate a 60,000 by 1000 grid using Matlab's ngrid function. While staying in the same script I often have to recalculate the grid for slightly different parameters. Each time I do it more time is required as measured by tic and toc.
The guts of the grid calculation are
% h=sampling interval, M= no. of samples
t=(1:M)*h; % time spacing
% fLfine=starting frequency, fRfine=stopping frequency % DelFreq=frequency interval
fs=fLfine:DelFreq:fRfine; % frequency spacing
[T F]=ndgrid(t,fs);
parameterList.A=exp(-1i*2*pi*F.*T);
T=[]; F=[];
Each time I pass through this calculation it takes longer. I notice it when I try the script on my Acer Aspire which has 4 gB memory. I don't notice it when I use my Toshiba Qosmio X775 which has 8 gB of memory and a faster processor.
Is there a reason why it takes progressively longer on the Acer and is there anything I can do about it?
Thanks,
Dave

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by