0000
		    0.9989    0.4334
</pre><pre class="codeinput">U0 = {rand(5,2),rand(4,2),[]}; <span class="comment">%&lt;-- Initial guess for factors of P</span>
P = parafac_als(X,2,struct(<span class="string">'dimorder'</span>,[3 2 1],<span class="string">'init'</span>,{U0}))
</pre><pre class="codeoutput">
CP_ALS:
 Iter  1: fit = 4.361298e-001 fitdelta = 4.4e-001
 Iter  2: fit = 5.082769e-001 fitdelta = 7.2e-002
 Iter  3: fit = 5.105738e-001 fitdelta = 2.3e-003
 Iter  4: fit = 5.116456e-001 fitdelta = 1.1e-003
 