edit svmtrain >>edit svmclassify >>edit svmpredict function [svm_struct, svIndex] = svmtrain(training, groupnames, varargin) %SVMTRAIN trains a support vector machine classifier % % SVMStruct = SVMTRAIN(TRAINING,GROUP) trains a support vector machine % classifier using data TRAINING taken from tw o groups given by GROUP
% SVMStruct contains information about the trained classifier that is % used by SVMCLASSIFY for classification
GROUP is a column vector of % values of the same length as TRAINING that defines two groups
Each % element of GROUP specifies the group the corresponding row of TRAINING % belongs to
GROUP can be a numeric vector, a string array, or a cell % array of strings
SVMTRAIN treats NaNs or empty strings in GROUP as % missing values and ignores the corresponding rows o