Can anyone tell me how to solve this error?

조회 수: 1 (최근 30일)
anand rathod
anand rathod 2020년 7월 24일
댓글: anand rathod 2020년 7월 25일
clc;
clear ;
close all;
%%
load FA
F1 = Feature;
load NF
F2 = Feature;
xdata = [F1;F2];
group = cell(1,1);
for ii = 1:size(F1,1)
group{ii,1} = 'Fatigue';
end
for ii = 1:size(F2,1)
group{ii+size(F1,1),1} = 'Non-Fatigue';
end
svmStruct = fitcsvm(xdata,group,'OptimizeHyperparameters','auto','HyperparameterOptimizationOptions',struct('showplot',true));
% Testing
save svm svmStruct
load svm
for ii = 1:size(F1,1)
species = ClassificationSVM(svmStruct,F1(ii,:));
disp([ group{ii,1} ' = ' species]);
end
for ii = 1:size(F2,1)
species = ClassificationSVM(svmStruct,F2(ii,:));
disp([ group{ii+size(F1,1),1} ' = ' species]);
end
%%%%%%%%%%%%%%%
It runs for some time and gives error on classificationSVM.
Here Xdata is a 8x4 double. error says X should be a double or a single matrix. How to solve it and the other errors?
  댓글 수: 5
Image Analyst
Image Analyst 2020년 7월 25일
If you need more help, attach FA.mat and NF.mat.
anand rathod
anand rathod 2020년 7월 25일
Image Analyst Here,

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

답변 (1개)

Jingwei Too
Jingwei Too 2020년 7월 24일

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by