function [Q,A,b,c] = setQP(yx,d) [n,cc] = size(yx); d = d+1; Q = zeros(n,n); A = yx(:,1)'; b = 0; c = (-1)*ones(n,1); for i = 1:n Q(i,i) = A(i)*A(i)*dot(yx(i,2:d),yx(i,2:d)); for j = i:n Q(i,j) = A(i)*A(j)*dot(yx(i,2:d),yx(j,2:d)); Q(j,i) = Q(i,j); endfor endfor