8a</a><br></p></div><!--
##### SOURCE BEGIN #####
%% Alternating least squares for CANDECOMP/PARAFAC (CP) Decomposition
% The function |cp_als| computes an estimate of the best rank-R
% CP model of a tensor X using the well-known alternating least-squares
% algorithm (see, e.g., Kolda and Bader, SIAM Review, 2009, for more
% information).  The input X can be almost any type of tensor inclusing a 
% |tensor|, |sptensor|, |ktensor|, or |ttensor|. The output CP model is a
% |ktensor|. 

%% Load some data 
% We