www.gusucode.com > mbc 工具箱 matlab 源码程序 > mbc/@mbcmodel/@project/Load.m

    function P = Load(P, filename)
%LOAD   Load a new project file.
% 
%   PROJECT = LOAD(PROJECT, FILENAME);
%
%   See also mbcmodel.project.Save, mbcmodel.project.SaveAs,
%   mbcmodel.project.New, mbcmodel/CreateProject, mbcmodel/LoadProject

%   Copyright 2004-2012 The MathWorks, Inc.

try
    % Lets attempt to load the new project
    [MP, msg] = loadMBCProject(P.Object, filename);
catch ME
    msg = ME.getReport;
end

% msg will contain an error message if the file fails to load
if isempty(msg)
    % Re-initialise with the new pointer
    P.pInitialise(MP);
else
    error(message('mbc:mbcmodel:project:LoadError', msg));
end