Feature selection code error

조회 수: 2 (최근 30일)
Meetul Choudhary
Meetul Choudhary 2023년 8월 14일
답변: Meetul Choudhary 2023년 8월 19일
CODE:
%% Testing Phase
load('testFeatures');
featvales=b2{1};
label=b2{2};
X = reshape(featvales, [], 1000)';
Y = label';
a1 = [];
for i=1:size(x,2)
if x(i)>0.5
x(i)=1;
else
x(i)=0;
end
end
for j=1:size(x,2)
if x(j)==1
b=X(:,j);
a1=\[a1 b\];
end
end
ERROR:
Index in position 2 exceeds array bounds (must not exceed 704).
Error in FeatureSelection (line 42)
b=X(:,j);
disp(sizeY)
1000 361
>> sizeA1 = size(a1)
sizeA1 =
1000 361
>> disp(size(x))
1 1000
>> disp(size(X))
1000 704
>> disp(size(featvales))
1 1 704 1000
>> disp(size(label))
1 704

채택된 답변

Meetul Choudhary
Meetul Choudhary 2023년 8월 19일
%%X=featvales';
X = permute(conj(featvales), [3, 4, 1, 2]);
Y=label';
a1=[];
this did the job

추가 답변 (0개)

카테고리

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

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by