%Generate a general solvable LCP

n = input('no of variables: ');
M = (rand(n,n) - rand(n,n))*10.0;
x=zeros(n,1);
y=zeros(n,1);
for i=1:n
    if     rand(1,1)>0.5
	x(i)=rand(1,1);
	y(i)=0.0;
    else
	x(i)=0.0;
	y(i)=rand(1,1);
    end
end
q=y-M*x;
save data M q n
save soln x y
end






