how to remove index exceeds matrix dimensions in matlab?reply me.

1 visualización (últimos 30 días)
prema13
prema13 el 8 de Mayo de 2016
Comentada: Walter Roberson el 8 de Mayo de 2016
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 comentarios
Walter Roberson
Walter Roberson el 8 de Mayo de 2016
In your line
run = runs + 1;
runs is not defined.
Walter Roberson
Walter Roberson el 8 de Mayo de 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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by