Solving Sudoku

I tried solving a 3 by 3 matrix by CVX. I know this is non-convex…
But i gave it a try by the following

cvx_begin
variables x(3,3) t

minimize norm(t,2)

subject to

x(1,1)==1
x(2,2)==3
x(3,2)==1
%x>0
sum(x,2)<=6+t
sum(x,2)>=5+t
sum(x,1)>5+t
sum(x,1)<=6+t
cvx_end

I am getting results which are not integers…Any suggestions?

Why would you expect the solutions to be integers? Your model does nothing to require them to be. Please read the users guide, in particular “The Basics”. This forum is not intended to be a substitute for the documentation.