Borrar filtros
Borrar filtros

Problem in svmtrain : Help

2 visualizaciones (últimos 30 días)
hamed abdulaziz
hamed abdulaziz el 19 de Abr. de 2014
Comentada: Anannya Sinha el 10 de Nov. de 2016
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.

Respuestas (1)

the cyclist
the cyclist el 19 de Abr. de 2014
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 comentarios
hamed abdulaziz
hamed abdulaziz el 19 de Abr. de 2014
Editada: hamed abdulaziz el 19 de Abr. de 2014
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 el 10 de Nov. de 2016
Can we try this with images ?

Iniciar sesión para comentar.

Categorías

Más información sobre Image Processing and Computer Vision en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by