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

조회 수: 1 (최근 30일)
prema13
prema13 2016년 5월 8일
댓글: Walter Roberson 2016년 5월 8일
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
Walter Roberson
Walter Roberson 2016년 5월 8일
In your line
run = runs + 1;
runs is not defined.
Walter Roberson
Walter Roberson 2016년 5월 8일
You need to post the complete error message, so that we do not need to guess about which line the error is occurring on.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by