the last two arguments.
[M,M0,output] = cp_opt(X, R, 'init', M_init,'lower',0);

%% Check the output
exitmsg = output.ExitMsg

%%
% The fit is the percentage of the data that is explained by the model.
% Because we have noise, we do not expect the fit to be perfect.
fit = output.Fit

%% Evaluate the output
% We can "score" the similarity of the model computed by CP and compare
% that with the truth. The |score| function on ktensor's gives a score in
% [0,1]  with 1 indicating a perfect match. Because we hav