Problem in svmtrain : Help

조회 수: 4 (최근 30일)
hamed abdulaziz
hamed abdulaziz 2014년 4월 19일
댓글: Anannya Sinha 2016년 11월 10일
I want to use SVMStruct = svmtrain(Training,Group) for classification But each element in the Training matrix is represented by cell array so after run that I got this error :
*Error using svmtrain (line 241)
TRAINING must be a numeric matrix.*
Could anyone guide how to correct this error,thank you.

답변 (1개)

the cyclist
the cyclist 2014년 4월 19일
One way to convert cell array categories to numerical categories is illustrated by the followign example:
Training = {'A','B','B','A','C','C'};
uniqueTraining = unique(Training);
[~,numericalTraining] = ismember(Training,uniqueTraining)
  댓글 수: 2
hamed abdulaziz
hamed abdulaziz 2014년 4월 19일
편집: hamed abdulaziz 2014년 4월 19일
the cyclist: Thank you very much,I have Training matrix 1*40 cells,and each cell is 75 rows * 10 columns,so I want to give this Training matrix to the svmtrain function but I got this error :
Error using svmtrain (line 241)
TRAINING must be a numeric matrix.*
Could you guide me how to correct this error,thank you.
Anannya Sinha
Anannya Sinha 2016년 11월 10일
Can we try this with images ?

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

카테고리

Help CenterFile Exchange에서 Image Processing and Computer Vision에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by