主要内容

Simulink.exportToVersion

导出模型,库或项目用于先前版本的金宝app

描述

example

exported_file= 金宝appsimulink.exporttoversion(modelname,target_filename,version)导出模型或库modelname到一个名称的文件target_filename以指定先前的simulink的格式金宝app®version可以加载。

如果系统包含指定的Simulink软件版本不支持的功能,则该命令将删除功能并用空蒙金宝app版子系统块彩色黄色替换所有不支持的块。金宝app结果,转换后的系统可能会产生不同的结果。

Thesave_system出口选项是此功能的旧选项,也是支持的。金宝app

example

exported_file= 金宝appsimulink.exporttoversion(modelname,target_filename,version,Name,Value)将其他选项指定为一个或多个名称值对参数。

example

导出_project= 金宝appsimulink.exporttoversion(Proj,ZipfileName,version)导出项目Proj到zip文件ZipfileName以指定先前的simulink的格式金宝appversion可以加载。

example

导出_project= 金宝appsimulink.exporttoversion(Proj,ZipfileName,version,exportReferencedProjects)导出顶级项目Proj以及所有引用ZIP文件的项目ZipfileName以指定先前的simulink的格式金宝appversion可以加载。

例子

全部收缩

获取当前的顶级系统并导出它。

Simulink.exportToVersion(bdroot,'mymodel.slx','R2014b');

Get the current top-level system and export it, replacing links to library blocks with copies of the library blocks in the saved file.

Simulink.exportToVersion(bdroot,'mymodel.slx','R2014b',“ BreakuserLinks”,true);

获取当前的顶级项目并导出它。

sldemo_slproject_airframe_references; proj = currentProject; Simulink.exportToVersion(proj,'myzipfilename','R2019a');

导出当前的顶级项目和所有参考项目。

金宝appsimulink.exporttoversion(proj,,'myzipfilename','R2019a',true);

Input Arguments

全部收缩

导出的模型,指定为字符向量或字符串标量,没有任何文件扩展名。该模型必须加载和未修饰。目标文件不得与模型文件相同。

Data Types:char|string

导出的文件名,指定为字符向量或字符串标量。目标文件不得与模型文件相同。

例子:'mymodel.slx'

Data Types:char|string

导出的项目, specified as amatlab.project.project目的。采用当前的项目to create a project object from the currently loaded project.

ZIP file name containing the exported project, specified as a character vector or string scalar.

例子:'myzipfile.zip'

Data Types:char|string

MATLAB发行名称,指定为字符向量或字符串标量,该名称指定了以前的Simulink版本。金宝appSimulink.exportToVersionexports the system to a format that the specified previous Simulink version can load. You cannot export to your current version. These version names are not case sensitive.

您可以使用后缀将模型文件格式指定为SLX或MDL_MDL或者_SLX. If you do not specify a format, you export your default model file format. You cannot specify the model files format when exporting a project.

If you use the Export to Previous Version dialog box instead ofSimulink.exportToVersion, then the另存为类型列表支持7金宝app年以前的版本。

例子:'R2015B'

Data Types:char|string

(可选)导出引用项目为先前的版本,指定为真或错误。

如果真实,Simulink.exportToVersion将顶级和所有引用项目导出到先前的版本中,并在zip文件中包括参考。提取ZIP文件会创建引用项目的副本,并将其链接到顶级项目。

If false,Simulink.exportToVersion仅将顶级项目导出到先前的版本。Simulink.exportToVersion保留与参考的现有绝对和相对链接。对于提取的工作项目,参考必须处于相同的绝对路径和相对路径。

如果项目没有参考,则忽略了该论点。

Name-Value Arguments

将可选的参数对Name1=Value1,...,NameN=ValueN, 在哪里Nameis the argument name and价值是相应的值。名称值参数必须在其他参数之后出现,但是对的顺序并不重要。

Before R2021a, use commas to separate each name and value, and encloseNamein quotes.

例子:

允许提示或消息对话框, specified by a logical value that indicates whether to display any output prompt or message in a dialog box or only messages at the command line. For example, prompts to make files writable, or messages about exported versions. If you want to allow prompts, then set to真的. or.

Output Arguments

全部收缩

导出文件的路径,以指定的先前Simulink版本可以加载的格式返回。金宝app

Path of the ZIP file containing the exported project, returned in the format that the specified previous Simulink version can load.

限制

Simulink.exportToVersiondoes not support exporting external test harnesses to previous releases.

  • 对于具有外部测试安全带的型号Simulink.exportToVersionautomatically converts them to internal test harnesses.

  • For projects containing models with external test harnesses,Simulink.exportToVersion导出项目s and reports the test harnesses as missing files.

Version History

Introduced in R2016a

看Also

Topics