[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bulk File loading problem
From: |
Søren Hauberg |
Subject: |
Re: Bulk File loading problem |
Date: |
Tue, 04 Jan 2011 21:52:16 +0100 |
tir, 04 01 2011 kl. 15:45 -0500, skrev Louis Ciotti:
> Sorry sent the original message before I was done typing.
> any ways I am loading a series of files like this:
>
> for k = 1:MaxFiles
> for i = 1:4
> dataraw=dlmread(sprintf ("./Data/TestData_%d_N_2_%d.csv",k,i),",",2,0)
> .
> .
> .
> .
> endfor
> endfor
>
> It works fine, however occasionally there is a missing file, and the
> .m file stops. Is there a way I can prevent this other than making
> sure that the file is not missing?
Can you put a try-catch block around the dlmread call? I.e. something
like
for k = 1:MaxFiles
for i = 1:4
try
dataraw=dlmread(sprintf ("./Data/TestData_%d_N_2_%
d.csv",k,i),",",2,0);
catch
end_try_catch
.
.
.
.
endfor
endfor
Søren