Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Index exeeds matix dimensions in loading image folder.

2 Ansichten (letzte 30 Tage)
Taiwo
Taiwo am 30 Jul. 2012
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
am a new person with MATLAB, but I want to load some images saved in a folder into an array and display/process. the error am having is "index exceeds matrix dimension" the code is given below:
H = 'C:\Users\Adigun\Documents\Naira.jpg';
myFolder = dir(fullfile(H,'Image1*.jpg'));
myFile = {myFolder.name};
numImage = numel(myFile);
I = imread(myfile{1});
myArray = zeros([size(I) numImage], class(I));
myArray(:,:,1) = I;
for p = 2:numImage
myArray(:,:,p) = imread(myfile{p});
end
the error is on this line: I = imread(myfile{1});
Pls somebody help

Antworten (1)

Albert Yam
Albert Yam am 30 Jul. 2012
If that is a direct copy of your code. Matlab is case sensitive, myFile and myfile.
myFile = {myFolder.name};
...
myArray(:,:,p) = imread(myfile{p}); %typo - Matlab is case sensitive

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by