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: find_order_ff.m
    path of file: ./repos/malini/Codes/FC_EC_calculation code/DynamicEC
    
    the code of the file until where you have to start completion: 
function [bic_smooth,ff_actual]=find_order_ff(data)
%use this function to find order bic_smooth for given data and forgetting factor ff_actual.
%order is found using Bayesion information criterion, forgetting factor is
%optimized by minimizing variance of error' power 
% data is extracted time series from regions, size(data)=M x N x S, where M=number of time points, N is number of regions and S is number of subjects
 addpath(genpath('C:\Users\szg0071\Documents\MATLAB\gui'))
    
function [bic_smooth,ff_actual]=find_order_ff(data)
%use this function to find order bic_smooth for given data and forgetting factor ff_actual.
%order is found using Bayesion information criterion, forgetting factor is
%optimized by minimizing variance of error' power 
% data is extracted time series from regions, size(data)=M x N x S, where M=number of time points, N is number of regions and S is number of subjects
 addpath(genpath('C:\Users\szg0071\Documents\MATLAB\gui'))

%   data = load('Sub_001.mat');
%   data = struct2cell(data);
%   data = cell2mat(data);
%   
count=1;
for k=1:size(data,2) %upto 190.
    for l=1:size(data,3)%size of this is 1.
        if (data(:,k,l)) ~= zeros(size(data,1),1)%the zeros part is 200 by 1 matrix.
        [bic(count),aic(count),bc,ac] = aks_find_model_order(squeeze(data(:,k,l))',2,20);
        count=count+1;
        end