Cannot open file using imread

I am trying to load images from a folder but I keep getting an error: "Error using imread (line 347) Cannot open file "./ARL_Stimuli_psych/" for reading. You might not have read permission." Also I am using psychtoolbox and the statistics toolbox
allSTIM=cell(1,length(trialseq_b));
for i=1:2:length(trialseq_b)
allSTIM{i} =imread(sprintf('./ARL_Stimuli_psych/%s',stimseq_b{i}));
end

 采纳的回答

Walter Roberson
Walter Roberson 2015-7-20

1 个投票

Your stimseq_b{i} is empty so you are trying to imread() the directory.
Side note: consider using fullfile() instead of the sprintf() that you are using.

1 个评论

Thank you, it was empty and I used fullfile() instead of sprintf()

请先登录,再进行评论。

更多回答(0 个)

类别

Community Treasure Hunt

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

Start Hunting!

Translated by