importdata() for large number of .txt files is veeery slow. How to improve it?
2 ビュー (過去 30 日間)
古いコメントを表示
I use the simple code below to create a 3D Matrix out of a bunch (e.g. 200) of txt files. Despite preallocation it takes quite long.
a = dir('*.txt');
Image=zeros(960,1280,200);
for i=1:length(a)
Image(:,:,i)=importdata(a(i).name);
end
Is there a way to speed it up? I know for example that the individual numbers are in 16bit UINT format, maybe that information could be used? Alternatively, I could produce smaller .tif files instead of .txt, in case the matlab image read functions are faster...
0 件のコメント
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!