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: generate_fc.m
    path of file: ./repos/CanlabCore/CanlabCore/External/2019_03_03_BCT
    
    the code of the file until where you have to start completion: function [FCpre,pred_data,Fcorr] = generate_fc(SC,beta,ED,pred_var,model,FC)
%   GENERATE_FC     Generation of synthetic functional connectivity matrices
%
%   [FCpre,pred_data,Fcorr] = generate_fc(SC,beta,ED,{'SPLwei_log','SIwei_log'},FC)

    
function [FCpre,pred_data,Fcorr] = generate_fc(SC,beta,ED,pred_var,model,FC)
%   GENERATE_FC     Generation of synthetic functional connectivity matrices
%
%   [FCpre,pred_data,Fcorr] = generate_fc(SC,beta,ED,{'SPLwei_log','SIwei_log'},FC)
%   [FCpre,pred_data] = generate_fc(SC,beta,[],{'SPLwei_log','SIwei_log'})
%
%   Uses a vector beta of regression coefficients from the model
%   FC = pred_var*beta to predict FC. pred_var are structural-based network
%   measures derived from the structural connectivity network.
%
%   Inputs:
%
%       SC,
%           Weighted/unweighted undirected NxN Structural Connectivity matrix.
%
%       beta,
%           Regression coefficients (vector). These may be obtained as an
%           output parameter from function predict_fc.m
%
%       ED,
%           Euclidean distance matrix or upper triangular vector of the
%           matrix (optional)
%
%       pred_var,
%           Set of M predictors. These can be given as an KxM array where
%           K = ((N*(N-1))/2) and M is the number of predictors.
%           Alternatively, pred_var can be a cell with the names of network
%           measures to be used as predictors. Accepted network measure
%           names are:
%               SPLbin        - Shortest-path length (binary)
%               SPLwei_inv    - Shortest-path length computed with an inv transform
%             	SPLwei_log    - Shortest-path length computed with a log transform
%             	SPLdist       - Shortest-path length computed with no transform
%              	SIbin         - Search Information of binary shortest-paths
%             	SIwei_inv     - Search Information of shortest-paths computed with an inv transform
%           	SIwei_log     - Search Information of shortest-paths computed with a log transform
%              	SIdist        - Search Information of shortest-paths computed with no transform
%              	T             - Path Transitivity
%              	deltaMFPT     - Column-wise z-scored mean first passage time
%               neighOverlap  - Neighborhood Overlap
%              	MI            - Matching Index
%
%           Predictors must be specified in the order that matches the
%           given beta values.
%
%      	model,
%           Specifies the order of the regression model used within
%           matlab's function regstats.m. 'model' can be any option
%           accepted by matlab's regstats.m function (e.g.'linear',
%           'interaction' 'quadratic', etc). If no model is specified,
%           'linear' is the default.
%
%    	FC,
%           Functional connections. FC can be a NxN symmetric matrix or a
%           ((N*(N-1))/2) x 1 vector containing the upper triangular
%           elements of the square FC matrix (excluding diagonal elements).
%           This argument is optional and only used to compute the
%           correlation between the predicted FC and empirical FC.
%
%
%   Outputs:
%
%       FCpre,
%           Predicted NxN Functional Connectivity matrix
%
%      	pred_data,
%           KxM array of predictors.
%
%       FCcorr,
%           Pearson Correlation between FCpred and FC
%
%
%   Reference: Goñi et al. (2014) PNAS 111: 833–838
%
%
%   Andrea Avena-Koenigsberger, Joaquin Goñi and Olaf Sporns; IU Bloomington, 2016


[b1,b2] = size(beta);
if b1 == 1 && b2 >= b1
    beta = beta';  % beta must be a column vector
elseif b1 > 1 && b2 > 1
    error('beta must be a vector of scalar regression coefficients')
end