how can I fix the insufficient error in fitsread command?

1 view (last 30 days)
I am using this loop to read 57 fits file which are about 4gig.
path='C:\Users\Kianfar\Documents\Thesis\DATA';
files=dir(path);
a=zeros(5,936,936,5,4);
as=zeros(5,936,936);
for i=3:7
a{i}=fitsread(strcat(path,'\',files(i).name));
for j=1:5
as{i}=as{i}+a{i}(:,:,j,1);
end
end
but it says:
Error using ==> double Out of memory. Type HELP MEMORY for your options.
Error in ==> fitsread>readprimary at 161 data = double(data)*bscale+bzero;
Error in ==> fitsread at 43 data = readprimary(info,raw);
  • _how can I fix this error?
p.s. the code works for 5 data, but not more than that._ *

Answers (0)

Community Treasure Hunt

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

Start Hunting!