cations, Chemometrics and 
% Intelligent Laboratory Systems, 1997, 38, 149-171.  
% This dataset can be found in the |doc| directory.
load aminoacids
%% Basic call to the method, specifying the data tensor and its rank
% This uses a _random_ initial guess. At each iteration, it reports the 'fit'
% which is defined as |1-(norm(X-M)/norm(X))| and is loosely the proportion
% of the data described by the CP model, i.e., a fit of 1 is perfect.
rng(3) %<- Setting random seed for reproducibility of this script
M1 