% exportToVersion - Exports a model, library or project for use in a
% previous version of Simulink.
%
% To export a Simulink model or library, use
%
% exported_file = Simulink.exportToVersion(modelname,target_filename,version)
% exported_file = Simulink.exportToVersion(modelname,target_filename,version,varargin)
%
% The model must be loaded and unmodified.  The target file must not be the
% same as the model file.  The version is a string, e.g. 'R2014b' or
% 'R2015a'.  Additional arguments are name-value pairs.  Allowed names
% are: BreakUserLinks, BreakToolboxLinks, AllowPrompt.  The value can be
% true, false, 'on' or 'off'.  The behaviour in each case is the same as
% the corresponding option in save_system.
%
% e.g.
%
% Simulink.exportToVersion(bdroot,'mymodel.slx','R2014b');
% Simulink.exportToVersion(bdroot,'mymodel.slx','R2014b','BreakUserLinks',true);
%
%
% To export a project, use
%
% exported_project = Simulink.exportToVersion(project, zipfilename, version, includeReferences)
%
% where project is the matlab.project.Project object for the current
% project, zipfilename is the name of the zip-file to be created and
% version is the name of the release to be exported to. Project export is
% supported for up to 7 years before the current release. Exporting a
% project exports all Simulink models, libraries, and data dictionaries to
% the specified release. All files in the project must be saved before
% exporting. 
%
% e.g.
%
% project = currentProject;
% Simulink.exportToVersion(project, "exportedProject.zip", "R2019a")
%
% To include project references in the exported project:
% Simulink.exportToVersion(project, "exportedProject.zip", "R2019a", true)

 
%  Copyright 2015-2022 The MathWorks, Inc.

