function [POS]=dosvm(M,Y,P,x,E,CLUSTER)
Y1=repmat(-1*Y,15,1);
M1=M.*Y1;
M2=[M1;Y];
N=[diag(M1)-1 ;0];
lambda=pinv(M2)*N;
[POS1,POS2]=find(lambda>=0);
W=0;
for i=1:1:length(POS1)
W=W+lambda(POS1(i))*Y(POS1(i))*P(:,POS1(i));
end
b=(W'*P(:,POS1(1))*Y(POS1(1))-1)*(-1)*Y(POS1(1));
%Projected training vectors
PSVMTRAINING=W'*P+b;
%The equation of the line on the plance X-Y, that seperates the first cluster with the rest is
%given as W(1)X+W(2)Y+b=0
%Projected testing vectors
figure
scatter(P(1,1:1:5),P(2,1:1:5),'s')
hold on
scatter(P(1,6:1:10),P(2,6:1:10),'d')
scatter(P(1,11:1:15),P(2,11:1:15),'v')
hold on
load TESTLPC
DATA=[];
for i=1:1:3
    DATA=[DATA TESTLPC{i}(1:1:x,:)];
end
U=isnan(DATA);
[R,S]=find(U==1);
for i=1:1:length(R)
    DATA(R(i),S(i))=eps;
end
P=E'*DATA;
%P=P-mi;
%P=P/ma;
PSVMTESTING=W'*P+b;
R=find(PSVMTESTING>0);
COL=[]
for i=1:1:length(R)
   F= find((CLUSTER-R(i))==0);
    COL=[COL F];
end
POS=(length(COL)/5)*100;    
scatter(P(1,1:1:5),P(2,1:1:5),'*')
hold on
scatter(P(1,6:1:10),P(2,6:1:10),'o')
scatter(P(1,11:1:15),P(2,11:1:15),'+')
hold on
X=-3:0.1:3;
Y=(-b-W(1)*X)/W(2);
scatter(X,Y)