'Out of Memory' error but no change in code
1 view (last 30 days)
Show older comments
So, its been a few weeks since i last ran this code. Now every time i run it i get an out of memory error. I've restarted my computer, increased the virtual memory, i'm not running any additional programs.
The code is simple but requires a heavy dose of processing to concatenate the 3D Matrix. Here is the code:
cd 'C:\ThermalImages'
img1=dlmread('image1.csv', ',', 7,1);
img2=dlmread('image2.csv', ',', 7,1);
img3=dlmread('image3.csv', ',', 7,1);
img4=dlmread('image4.csv', ',', 7,1);
img5=dlmread('image5.csv', ',', 7,1);
img6=dlmread('image6.csv', ',', 7,1);
img7=dlmread('image7.csv', ',', 7,1);
img8=dlmread('image8.csv', ',', 7,1);
img9=dlmread('image9.csv', ',', 7,1);
img10=dlmread('image10.csv', ',', 7,1);
Matrix3D = cat(3,img1, img2, img3, img4, img5, img6, img7, img8, img9, img10);
figure;
xslice=120;
yslice=160;
zslice=1;
h=slice(Matrix3D,xslice,yslice,zslice,'spline');
colorbar;
caxis([75,100]);
shading interp;
colormap('jet');
set(gca,'ZDir','reverse');
figure;
j=slice(Matrix3D,xslice,yslice,zslice,'spline');
colorbar;
caxis([75,100]);
shading interp;
colormap('jet');
set(gca,'Zdir','reverse');
view([180,0]);
I'm basically taking 10 excel spreadsheets from CSV format and concatenating them into a 3D Matrix so I can take a slice down the middle. I used to run into memory errors if i tried to run the code multiple time (4-5) in a row. Now it won't even run once. I haven't changed anything about the code.
Is there anything i can do to reset any settings in MatLab R2013a to get back to its original state? Is there a more efficient way to process this data? Is there anything else i can do to get back to a working system?
Thank you, Michael
1 Comment
Ken Atwell
on 17 May 2014
After the out of memory error, can you type 'whos' and post the output here?
Answers (0)
See Also
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!