You can use fmincon.
Here is the documentation for the function:
http://www.mathworks.in/help/optim/ug/fmincon.html
The objective function would have to be written in a separate m-file which takes a vector x as it's input and returns a scalar output. Multiple variables are passed as x[1], x[2], x[3] etc.
x0 is a vector of initial guesses for the variables. Here they are all initialized to 1. It's of length 12 here as there seem to be 12 variables (including 'M').
x0 = ones(12,1)
[x,fval] = fmincon(@fun,x0,[],[],[],[],zeros(12,1),[])
This link will help you understand how to write the objective functions for multiple variables:
http://www.mathworks.in/help/optim/ug/writing-objective-functions.html#brhkghv-4