n>
    <span class="string">'Factor_Generator'</span>, <span class="string">'nvecs'</span>);
</pre><pre class="codeinput"><span class="comment">% Run the algorithm</span>
[M_plus,~,output] = cp_opt(X, R+1, <span class="string">'init'</span>, M_plus_init);
exitmsg = output.ExitMsg
fit = output.Fit
</pre><pre class="codeoutput">Iter    10, f(x) = 1.239651e+03, ||grad||_infty = 9.54e+01
Iter    20, f(x) = 1.204230e+03, ||grad||_infty = 1.30e+00
Iter    30, f(x) = 1.202606e+03, ||grad||_infty = 1.08e+01
Iter   