You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: ffa.m
    path of file: ./repos/bnt/BNT/examples/static/Zoubin
    
    the code of the file until where you have to start completion: % function [L,Ph,LL]=ffa(X,K,cyc,tol);
% 
% Fast Maximum Likelihood Factor Analysis using EM
%
% X - data matrix
% K - number of factors
% cyc - maximum number of cycles of EM (default 100)
% tol - termination tolerance (prop change in likelihood) (default 0.0001
    
function [L,Ph,LL]=ffa(X,K,cyc,tol);
% 
% Fast Maximum Likelihood Factor Analysis using EM
%
% X - data matrix
% K - number of factors
% cyc - maximum number of cycles of EM (default 100)
% tol - termination tolerance (prop change in likelihood) (default 0.0001)
%
% L - factor loadings 
% Ph - diagonal uniquenesses matrix
% LL - log likelihood curve
%
% Iterates until a proportional change < tol in the log likelihood 
% or cyc steps of EM 
%

function [L,Ph,LL]=ffa(X,K,cyc,tol);

if nargin<4  tol=0.0001; end