필터 지우기
필터 지우기

Index exceeds the number of array elements (2).

조회 수: 1 (최근 30일)
sun rise
sun rise 2022년 3월 13일
답변: Walter Roberson 2022년 5월 21일
load featurs_T
load featurs_S
load Group_Train
load Group_Test
load featurs_TLBP
load featurs_SLBP
result= multisvm(Feat1,Group_Train1,Feat2,Group_Test1);
result1= result;
result= multisvm(Feat1LBP,Group_Train1,Feat2LBP,Group_Test1);
result2=result;
% First we concatenate all prediciton arrays into one big matrix.
% Make sure that all prediction arrays are of the same type, I am assumming here that they
% are type double. I am also assuming that all prediction arrays are column vectors.
Prediction = [result1,result2];
Final_decision = zeros(length(Feat2),1);
all_results = [1,2]; %possible outcomes
for row = 1:length(Feat2)
election_array = zeros(1,2);
for col = 1:2 %your five different classifiers
election_array(Prediction(row,col)) = ...
election_array(Prediction(row,col))+1;
end
[~,I] = max(election_array);
Final_decision(row) = all_results(I);
end
  댓글 수: 8
sun rise
sun rise 2022년 5월 21일
I have attached a picture. Sizes are shown in work space

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

채택된 답변

Walter Roberson
Walter Roberson 2022년 5월 21일
max() of a 2d array is a vector so I is a vector. all_results(I) is a vector. You are trying to assign that vector to a scalar left side.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Classification에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by