Does repeated use of ngrid suck up memory?

1 回表示 (過去 30 日間)
David Koenig
David Koenig 2012 年 9 月 22 日
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 Center および File ExchangeDiscrete Fourier and Cosine Transforms についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by