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: Construct_iMSF.m
    path of file: ./repos/MALSAR/MALSAR/functions/iMSF
    
    the code of the file until where you have to start completion: %% FUNCTION Construct_iMSF
%   Prepares input for iMSF optimization. This function is not intended to 
%   directly called by users. See the Logistic_iMSF function.
%
%% LICENSE
%   This program is free software: you can redistribute it and/or modify
%   it under the terms of the GNU General Public License as published by
%   the Free Software Foundation, either version 3 of the License, or
%   (at your option) any later version.
%
%   This program is distributed in the hope that it will be useful,
%   but WITHOUT ANY WARRANTY; without even the implied warranty of
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%   GNU General Public License for more details.
%
%   You should have received a copy of the GNU General Public License
%   along with this program.  If not, see <http://www.gnu.org/licenses/>.
%
%   Copyright (C) 2011 - 2012 Lei Yuan, Jiayu Zhou, and Jieping Ye
%
%   You are suggested to first read the Manual.
%   For any problem, please contact with Jiayu Zhou via jiayu.zhou@asu.edu
%
%   Last modified on June 12, 2012.
%
%% RELATED FUNCTIONS
%   init_opts, Construct_iMSF, Logistic_iMSF, MultiSource_LogisticR

function [A_Set, Y_Set, W, G, ind, PS, A_Set_Complete] = Construct_iMSF(X_Set, Y)
% 

X = [];
temp = [];
IndMissing = [];
    
function is not intended to 
%   directly called by users. See the Logistic_iMSF function.
%
%% LICENSE
%   This program is free software: you can redistribute it and/or modify
%   it under the terms of the GNU General Public License as published by
%   the Free Software Foundation, either version 3 of the License, or
%   (at your option) any later version.
%
%   This program is distributed in the hope that it will be useful,
%   but WITHOUT ANY WARRANTY; without even the implied warranty of
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%   GNU General Public License for more details.
%
%   You should have received a copy of the GNU General Public License
%   along with this program.  If not, see <http://www.gnu.org/licenses/>.
%
%   Copyright (C) 2011 - 2012 Lei Yuan, Jiayu Zhou, and Jieping Ye
%
%   You are suggested to first read the Manual.
%   For any problem, please contact with Jiayu Zhou via jiayu.zhou@asu.edu
%
%   Last modified on June 12, 2012.
%
%% RELATED FUNCTIONS
%   init_opts, Construct_iMSF, Logistic_iMSF, MultiSource_LogisticR

function [A_Set, Y_Set, W, G, ind, PS, A_Set_Complete] = Construct_iMSF(X_Set, Y)
% 

X = [];
temp = [];
IndMissing = [];
nF = [];
FeatureTypes = cell(length(X_Set), 1);

for i = 1:length(X_Set)
    temp = X_Set{i};
    FeatureTypes{i} = sprintf('%d', i);
    
    temp(~isnan(temp(:, 1)), :) = zscore(temp(~isnan(temp(:, 1)), :));
    
    IndMissing = [IndMissing ~isnan(temp(:, 1))];
    X = [X temp];
    nF = [nF size(temp, 2)];
end