Error:
Subscript indices must either be real positive integers or logicals.
Hi I am doing image conversion and I get an error when checking the size of the matrix. I am confused as to why I am getting it for this particular instance with the code:
size(maleGrey)
Here is the code I am running:
male = getAllFiles('male');
% Variable Initialization
size = 250*250;
numM = length(male);
maleGrey = zeros(size,numM);
% Convert to gray scale
for i = 1:numM
rgb = imread(char(male(i)));
img = single(rgb2gray(rgb));
vec = img(:); % make it a vector of (62500,1) in size
maleGrey(:,i) = vec;
end