075     <span class="keyword">for</span> idx=1:pen.constr
0076       brows=[brows;idx*ones(pen.bi_dim(idx),1)];
0077     <span class="keyword">end</span>
0078     B = sparse(brows,pen.bi_idx+1,pen.bi_val,pen.constr,Nx,nnzB);
0079     bmidata.B = B;
0080     bmidata.ubg = pen.ci;
0081   <span class="keyword">end</span>
0082 
0083   <span class="comment">% matrix constraints</span>
0084   <span class="keyword">if</span> (isfield(pen,<span class="string">'mconstr'</span>) &amp;&amp; ~isempty(pen.mconstr) &amp;