Here is a simple code for image classification using Support Vector Machines (SVM) in MATLAB:
main.m501 chars26 lines
In this example, meas contains the measurements of the iris flowers, X is the feature matrix with petal length and width as the features, species is the categorical target vector, and SVMModel is the fitted SVM model. The SVM boundary is plotted using gscatter and ezplot functions.
This is a simple example and the classification accuracy can be improved by using more features and more sophisticated algorithms.
gistlibby LogSnag