hi everyone.,how to solve Index exceeds matrix dimensions in this particular code ?
Show older comments
error:
Index exceeds matrix dimensions.
Error in download (line 19)
if ~exist(fullfile(output_directory, [regexprep(urls{i}(24, end), '/', '_')]))
code:
output_directory = 'sbu_images';
urls = textread('SBU_captioned_photo_dataset_urls.txt', '%s', -1);
if ~exist(output_directory, 'dir')
mkdir(output_directory);
end
rand('twister', 123);
urls = urls(randperm(length(urls)));
for i = 1 : length(urls)
if ~exist(fullfile(output_directory, [regexprep(urls{i}(24, end), '/', '_')]))
cmd = ['wget -t 3 -T 5 --quiet ' urls{i} ...
' -O ' output_directory '/' regexprep(urls{i}(24, end), '/', '_')];
unix(cmd);
fprintf('%d. %s\n', i, urls{i});
end
end
Accepted Answer
More Answers (0)
Categories
Find more on Startup and Shutdown 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!