function simStateSlice = compileSlicedModel(msObj,slicedMdl, simHandler)
    % Utility function to compile sliced model for compile time checking
    % and for taking SimState if SimState slicing needs to be done. 
    
    %   Copyright 2015 The MathWorks, Inc.
    
    simStateSlice = [];
    if ~msObj.isSimStateSlice
        feval(slicedMdl,'init');
    else
        simHandler.run;
        simStateSlice = simHandler.getSimState();
    end
end
