# Hyperplane equation in SVM using Matlab

I want to get a equation of hyperplane in SVM classifier using Matlab in the case of linear separable data which is the easiest case. Actually I do not want to use Kernel function. Is there any way to find the equation of hyperplane in matlab?

All you need can be computed from kernel and support vectors. Matlab stores them in svmStruct. Just call the svmStrain function with autscale on false.

% parameters from svmStruct
w1 = dot(svmStruct.Alpha, svmStruct.SupportVectors(:,1));
w2 = dot(svmStruct.Alpha, svmStruct.SupportVectors(:,2));
bias = svmStruct.Bias;

% y = a*x + b
a = -w1/w2;
b = -svmStruct.Bias/w2;