symbolic matrix with fixed elements
<p>I am trying to create a symbolic matrix but I want to fix some of it elements to 0 in order to reduce the size of the problem. I also want to send all the values to be positive. I have tried this:</p>

<pre><code>X   = sym ('x',[n,n]);
X = sym(X,'positive');
X=times(X,Xf);
</code></pre>

<p>where Xf is an nxn matrix with zeros where I want to have fixed values and ones where I want to have the variables in the matrix.</p>

<p>When I solve the problem using <code>fminunc</code> I get some negative values and I also have non zero values for the values I wanted to fix.</p>

<p>n in my case is 30 and solving it with <code>fmincon</code> was not possible</p>