1function sim = linearKernel(x1, x2) 2%LINEARKERNEL returns a linear kernel between x1 and x2 3% sim = linearKernel(x1, x2) returns a linear kernel between x1 and x2 4% and returns the value in sim 5 6% Ensure that x1 and x2 are column vectors 7x1 = x1(:); x2 = x2(:); 8 9% Compute the kernel 10sim = x1' * x2; % dot product 11 12end 13