- Install more memory (twice as much is a good strategy)
- Because RAM is cheap even more memory is fine
- Stop other applications, which occupy memory
- Clear unused variables in Matlab
- Use smaller data types if possible (a double needs 8 bytes, a uint16 only 2)
- Use a 64-bit system and Matlab, such that you can use the bunch of gigabytes you have installed according to the points 1. and 2.
- Install more memoryYou find exactly the same answers, when you search in the forum for "Out of memory".
Out of memory. Type HELP MEMORY for your options.
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi, Please find below code.It gives Out of memory. HELP MEMORY for your options.Error in val = ltln2val(double(map),mapref,lats,longs,'bilinear'); . Please help me resolving this.
if true
% code
end
cd cards;
[Z_UP, R_UP] = geotiffread('srtm_49_01.tif');
[Z_DOWN, R_DOWN] = geotiffread('srtm_49_02.tif');
GRID_SIZE=size(Z_UP,1);
map=[Z_UP;Z_DOWN];
mapref=R_UP;
if GRID_SIZE==6000
mapref.RasterSize=[12000 6000];
mapref.LatitudeLimits=[50 60];
mapref.LongitudeLimits=[60 65];
else
mapref.RasterSize=[12002 6001];
mapref.LatitudeLimits=[50 60];
mapref.LongitudeLimits=[60 65];
end
lat1=54.99889;
lon1=60.37778;
lat2=55.12726;
lon2=60.57104;
ERinMeter=6371000;
distInMeters=distance(lat1,lon1,lat2,lon2,ERinMeter);
disc_number=distInMeters;
lats=linspace(lat1,lat2,disc_number);
longs=linspace(lon1,lon2,disc_number);
val = ltln2val(double(map),mapref,lats,longs,'bilinear');
dist=distance(lat1,lon1,lat2,lon2,'degrees');
dist=deg2km(dist)*1000;
dist=linspace(0,dist,disc_number);
X=dist;
Y=val;
figure
plot(X,Y,'-r');
Thanks, Mary
댓글 수: 0
답변 (2개)
Jan
2015년 8월 3일
The question to "out of memory" are as usual:
댓글 수: 0
Kelly Kearney
2015년 8월 3일
While the previous answers will resolve generic memory issues, I would first suggest seeing if you really need the memory-intensive part of your code. It looks like you're trying to interpolate values along a single line within a very large image, and the portion of the code that's causing errors is your attempt to convert the entire image to a double array. However, you don't need the entire image to accomplish your task, just the portion near the line itself. I suggest breaking the image into smaller subgrids and then only performing the interpolation using the subgrids near your line.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!