how to remove index exceeds matrix dimensions in matlab?reply me.
1 view (last 30 days)
Show older comments
num_images = numel(filenames); %num_images=165
image_dims = [40 40];
images = zeros(prod(image_dims),num_images);
PI = 11; images per person
P = 15 no. of person
id = zeros(20,PI);
for i = 1:20 % i is runs time means i run 10 times
id(i,:) = randperm(PI);
end
save id
run = runs + 1;
for k = 1:run
disp(k);
m = id(k,:);
for i = 1:15
for j = 1:11
ind = (i-1) * 11 + j;
if (m(1) == j) || (m(2) == j)
ind1 = [ind1 ind];
else
ind2 = [ind2 ind];
end
end
end
train = images(:,ind2);
test = images(:,ind1);
2 Comments
Walter Roberson
on 8 May 2016
You need to post the complete error message, so that we do not need to guess about which line the error is occurring on.
Answers (0)
See Also
Categories
Find more on Get Started with MATLAB 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!