Here is a part of the data and the time that the script Thank you in advance!
Make a sript faster
1 view (last 30 days)
Show older comments
Hello everyone,
Does anyone know how to make this script faster knowing that I have 800 matrix to import?
pathname = uigetdir();
cycle = cell(2,400);
for i = 1:2
for j = 1:100
for k = 1:4
filename = sprintf('Cycle%d_Image%d_%d.csv', j, k, i);
if exist(fullfile(pathname, filename), 'file')~=2
error('File not found: %s', fullfile(pathname, filename))
end
strrepInFile(fullfile(pathname, filename), ',', '.');
cycle{i,4*(j-1)+k} = dlmread(fullfile(pathname, ['new_' filename]), ';');
delete(fullfile(pathname, ['new_' filename]))
end
end
end
7 Comments
Walter Roberson
on 16 Apr 2019
dlmread calls textscan. You can avoid some overhead by calling textscan yourself especially if the files have fixed format.
Answers (0)
See Also
Categories
Find more on File Operations 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!