## Multiple constraints optimization problem in matlab

How can I solve an optimization problem with multiple constraints in matlab?

I am trying to solve for:

```
min g(M)
subject to
- If C(i,j) > a, then g(M(i,j)) > alpha
- If C(i,j) < b, then g(M(i,j)) < -alpha
- else, -alpha <= g(M(i,j)) <= alpha
```

I read about the optimization toolbox, but I couldn’t find an example similar to what I am trying to achieve. Is it possible to solve such an optimization problem?

**EDIT**: Concrete example

I tried using the “fmincon” tool, but couldn’t get it to work. The error message tells me that I did not give enough input arguments, but I can’t figure out why.

Here is a concrete example of such an optimization problem (I gave a special example for the function g, but in practice I would like to be able to plug in many different functions):

Consider $g(M)=sum_{i,j}{sqrt{|M_{i,j}|}}$,

Where

$M$ is a 3 by 3 matrix.

I reformulated slightly the optimization problem as follows

Solve $min_{M,gamma}{g(M)+gamma}$

subject to

$||M||_{1} < gamma$

$gamma > 0$

$C_{i,j} > a => M_{i,j} > alpha $

$C_{i,j} < b => M_{i,j} < beta$

$ b < C_{i,j} < a => beta < M_{i,j} < alpha$

with parameters:

$alpha = 0.5$

$beta = -0.2$

$a = 3$

$b = -1$

$C = left[begin{matrix}

-5 & 2 & 3 \

8 & -8 & 4 \

0 & 7 -& 1end{matrix}right]$