升级顾问
R2026b修复模型并将其升级到当前版本
描述
使用升级顾问修复您的 Simulink® 模型并将其升级到当前版本。
升级顾问可以帮助您:
确定由于 Simulink 中的行为变化或改进而不再有效的模型。
确定您可以通过使用 Simulink 中新发布的功能和设置来增强的模型。
通过执行自动升级或提供手动修复说明,转换为新技术并升级模型层次结构。
有关将升级顾问用于您的模型的详细信息,请参阅使用升级顾问升级模型。

打开 升级顾问
Simulink 编辑器:在建模选项卡中,选择模型顾问 > 升级顾问。
MATLAB® 命令行窗口:
upgradeadvisor("modelname")模型顾问:在模型顾问中,点击升级顾问。
示例
打开 vdp 示例模型。
openExample("vdp.slx");
要运行单个检查,请右键点击该检查并选择运行此检查。或者,选择该检查并使用右窗格中的按钮。

打开
vdp示例模型的升级顾问。openExample("vdp.slx"); upgradeadvisor("vdp")
您也可以打开当前所选模型的升级顾问。
upgradeadvisor(bdroot)
此示例说明如何分析和升级您的模型,然后在自动修复可用时应用它们。
1.加载您的模型并创建一个 upgrader 对象。在此示例中,要加载并打开示例模型,请打开包含该模型的工程。
openProject("ModelReferenceHierarchy"); upgrader = upgradeadvisor("sldemo_mdlref_depgraph.slx")
upgrader =
Upgrader with properties:
ChecksToSkip: {}
SkipLibraries: 0
SkipBlocksets: 1
OneLevelOnly: 0
ShowReport: 1
VerboseLogging: 0
EnableBackups: 1
Summaries: []
RootModel: 'sldemo_mdlref_depgraph'
ReportFile: ''
Run "upgrade" on this Upgrader object to analyze and automatically upgrade your models.
2.分析模型是否适合推荐的升级、跟踪库链接和模型引用。
analyze(upgrader);
(1/-) Analyzing Model "sldemo_mdlref_depgraph" Updating Model Advisor cache... Model Advisor cache updated. For new customizations, to update the cache, use the Advisor.Manager.refresh_customizations method. (2/14) Analyzing Model "sldemo_mdlref_heat2cost" (3/14) Analyzing Model "sldemo_mdlref_house" (4/14) Analyzing Model "sldemo_mdlref_F2C" (5/14) Analyzing Model "sldemo_mdlref_outdoor_temp" (6/14) Analyzing Model "sldemo_mdlref_thermostat" (7/14) Analyzing Model "sldemo_mdlref_heater" (8/14) Analyzing Model "sldemo_mdlref_heat2cost" using compile time information (9/14) Analyzing Model "sldemo_mdlref_house" using compile time information (10/14) Analyzing Model "sldemo_mdlref_F2C" using compile time information (11/14) Analyzing Model "sldemo_mdlref_outdoor_temp" using compile time information ### Searching for referenced models in model 'sldemo_mdlref_outdoor_temp'. ### Unable to find Simulink cache file "sldemo_mdlref_F2C.slxc". ### Total of 1 models to build. ### Starting serial code generation build. ### Starting model reference code generation target build for: sldemo_mdlref_F2C ### Build reason: "sldemo_mdlref_F2C.c" did not exist. ### Build folder for generated code: /tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_F2C ### TLC front end (took 0.217s). ### Invoking Target Language Compiler on sldemo_mdlref_F2C.rtw ### Using System Target File: /mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/rtw/c/grt/grt.tlc ### Loading TLC function libraries ....... ### Initial pass through model to cache user defined code . ### Caching model source code ..................................... ### Writing header file sldemo_mdlref_F2C_types.h ### Writing header file sldemo_mdlref_F2C.h ### Writing header file rtwtypes.h . ### Writing header file multiword_types.h ### Writing source file sldemo_mdlref_F2C.c ### Writing header file sldemo_mdlref_F2C_private.h ### TLC code generation complete (took 1.876s). ### Saving binary information cache. ### Using toolchain: GNU gcc/g++ | gmake (64-bit Linux) ### Creating '/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_F2C/sldemo_mdlref_F2C.mk' ... ### Building 'sldemo_mdlref_F2C_rtwlib': "/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/bin/glnxa64/gmake" -j 4 -l 4 -f sldemo_mdlref_F2C.mk all gcc -c -fwrapv -fPIC -Wno-error=incompatible-pointer-types -Wno-error=stringop-overflow -O0 -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DMAT_FILE=0 -DONESTEPFCN=0 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DTID01EQ=1 -DMODEL=sldemo_mdlref_F2C -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DRT -DUSE_RTMODEL -I/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988 -I/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_F2C -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/extern/include -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/simulink/include -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/rtw/c/src -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/rtw/c/src/ext_mode/common -I/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/_sharedutils -o "sldemo_mdlref_F2C.o" "/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_F2C/sldemo_mdlref_F2C.c" ### Creating static library "./sldemo_mdlref_F2C_rtwlib.a" ... ar ruvs ./sldemo_mdlref_F2C_rtwlib.a sldemo_mdlref_F2C.o ar: `u' modifier ignored since `D' is the default (see `U') ar: creating ./sldemo_mdlref_F2C_rtwlib.a a - sldemo_mdlref_F2C.o ### Created: "./sldemo_mdlref_F2C_rtwlib.a" ### Successfully generated all binary outputs. gmake: Nothing to be done for `all'. ### Successfully updated the model reference code generation target for: sldemo_mdlref_F2C ### Simulink cache artifacts for 'sldemo_mdlref_F2C' were created in '/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/sldemo_mdlref_F2C.slxc'. Build Summary Model reference code generation targets: Model Build Reason Status Build Duration ============================================================================================================ sldemo_mdlref_F2C Target (sldemo_mdlref_F2C.c) did not exist. Code generated and compiled. 0h 0m 9.6364s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 11.313s ### Searching for referenced models in model 'sldemo_mdlref_outdoor_temp'. ### Total of 1 models to build. ### Starting serial model build. ### Starting model reference simulation target build for: sldemo_mdlref_F2C ### Successfully updated the model reference simulation target for: sldemo_mdlref_F2C Build Summary Model reference simulation targets: Model Build Reason Status Build Duration ===================================================================================================================== sldemo_mdlref_F2C Target (sldemo_mdlref_F2C_msf.mexa64) did not exist. Code generated and compiled. 0h 0m 8.0558s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 8.5078s ### Searching for referenced models in model 'sldemo_mdlref_outdoor_temp'. ### Total of 1 models to build. ### Model reference simulation target for sldemo_mdlref_F2C is up to date. Build Summary 0 of 1 models built (1 models already up to date) Build duration: 0h 0m 0.46942s (12/14) Analyzing Model "sldemo_mdlref_thermostat" using compile time information (13/14) Analyzing Model "sldemo_mdlref_heater" using compile time information ### Searching for referenced models in model 'sldemo_mdlref_heater'. ### Skipped unpacking from Simulink cache file "sldemo_mdlref_F2C.slxc" because the relevant build artifacts on disk are up to date. ### Unable to find Simulink cache file "sldemo_mdlref_thermostat.slxc". ### Total of 2 models to build. ### Model reference code generation target for sldemo_mdlref_F2C is up to date. ### Starting serial code generation build. ### Starting model reference code generation target build for: sldemo_mdlref_thermostat ### Build reason: "sldemo_mdlref_thermostat.c" did not exist. ### Build folder for generated code: /tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_thermostat ### Invoking Target Language Compiler on sldemo_mdlref_thermostat.rtw ### Using System Target File: /mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/rtw/c/grt/grt.tlc ### Loading TLC function libraries ....... ### Initial pass through model to cache user defined code . ### Caching model source code ...................................... ### Writing header file sldemo_mdlref_thermostat_types.h ### Writing header file sldemo_mdlref_thermostat.h ### Writing source file sldemo_mdlref_thermostat.c ### Writing header file sldemo_mdlref_thermostat_private.h ### TLC code generation complete (took 1.101s). ### Saving binary information cache. ### Using toolchain: GNU gcc/g++ | gmake (64-bit Linux) ### Creating '/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_thermostat/sldemo_mdlref_thermostat.mk' ... ### Building 'sldemo_mdlref_thermostat_rtwlib': "/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/bin/glnxa64/gmake" -j 4 -l 4 -f sldemo_mdlref_thermostat.mk all gcc -c -fwrapv -fPIC -Wno-error=incompatible-pointer-types -Wno-error=stringop-overflow -O0 -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DMAT_FILE=0 -DONESTEPFCN=0 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DTID01EQ=1 -DMODEL=sldemo_mdlref_thermostat -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DRT -DUSE_RTMODEL -I/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988 -I/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_thermostat -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/extern/include -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/simulink/include -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/rtw/c/src -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/rtw/c/src/ext_mode/common -I/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/_sharedutils -o "sldemo_mdlref_thermostat.o" "/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_thermostat/sldemo_mdlref_thermostat.c" ### Creating static library "./sldemo_mdlref_thermostat_rtwlib.a" ... ar ruvs ./sldemo_mdlref_thermostat_rtwlib.a sldemo_mdlref_thermostat.o ar: `u' modifier ignored since `D' is the default (see `U') ar: creating ./sldemo_mdlref_thermostat_rtwlib.a a - sldemo_mdlref_thermostat.o ### Created: "./sldemo_mdlref_thermostat_rtwlib.a" ### Successfully generated all binary outputs. gmake: Nothing to be done for `all'. ### Successfully updated the model reference code generation target for: sldemo_mdlref_thermostat ### Simulink cache artifacts for 'sldemo_mdlref_thermostat' were created in '/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/sldemo_mdlref_thermostat.slxc'. Build Summary Model reference code generation targets: Model Build Reason Status Build Duration ========================================================================================================================== sldemo_mdlref_thermostat Target (sldemo_mdlref_thermostat.c) did not exist. Code generated and compiled. 0h 0m 2.9352s 1 of 2 models built (1 models already up to date) Build duration: 0h 0m 3.4769s ### Searching for referenced models in model 'sldemo_mdlref_heater'. ### Total of 1 models to build. ### Starting serial model build. ### Starting model reference simulation target build for: sldemo_mdlref_thermostat ### Successfully updated the model reference simulation target for: sldemo_mdlref_thermostat Build Summary Model reference simulation targets: Model Build Reason Status Build Duration =================================================================================================================================== sldemo_mdlref_thermostat Target (sldemo_mdlref_thermostat_msf.mexa64) did not exist. Code generated and compiled. 0h 0m 4.6671s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 5.1152s ### Searching for referenced models in model 'sldemo_mdlref_heater'. ### Total of 1 models to build. ### Model reference simulation target for sldemo_mdlref_thermostat is up to date. Build Summary 0 of 1 models built (1 models already up to date) Build duration: 0h 0m 0.23916s (14/14) Analyzing Model "sldemo_mdlref_depgraph" using compile time information ### Searching for referenced models in model 'sldemo_mdlref_depgraph'. ### Skipped unpacking from Simulink cache file "sldemo_mdlref_heat2cost.slxc" because the file does not have the relevant build artifacts. ### Skipped unpacking from Simulink cache file "sldemo_mdlref_heater.slxc" because the file does not have the relevant build artifacts. ### Skipped unpacking from Simulink cache file "sldemo_mdlref_F2C.slxc" because the relevant build artifacts on disk are up to date. ### Skipped unpacking from Simulink cache file "sldemo_mdlref_thermostat.slxc" because the relevant build artifacts on disk are up to date. ### Skipped unpacking from Simulink cache file "sldemo_mdlref_house.slxc" because the file does not have the relevant build artifacts. ### Unable to find Simulink cache file "sldemo_mdlref_outdoor_temp.slxc". ### Total of 6 models to build. ### Model reference code generation target for sldemo_mdlref_F2C is up to date. ### Model reference code generation target for sldemo_mdlref_thermostat is up to date. ### Starting serial code generation build. ### Starting model reference code generation target build for: sldemo_mdlref_heat2cost ### Build reason: "sldemo_mdlref_heat2cost.c" did not exist. ### Build folder for generated code: /tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_heat2cost ### Invoking Target Language Compiler on sldemo_mdlref_heat2cost.rtw ### Using System Target File: /mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/rtw/c/grt/grt.tlc ### Loading TLC function libraries ....... ### Initial pass through model to cache user defined code . ### Caching model source code ................................................ ### Writing header file sldemo_mdlref_heat2cost_types.h ### Writing header file sldemo_mdlref_heat2cost.h ### Writing source file sldemo_mdlref_heat2cost.c ### Writing header file sldemo_mdlref_heat2cost_private.h . ### TLC code generation complete (took 1.078s). ### Saving binary information cache. ### Using toolchain: GNU gcc/g++ | gmake (64-bit Linux) ### Creating '/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_heat2cost/sldemo_mdlref_heat2cost.mk' ... ### Building 'sldemo_mdlref_heat2cost_rtwlib': "/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/bin/glnxa64/gmake" -j 4 -l 4 -f sldemo_mdlref_heat2cost.mk all gcc -c -fwrapv -fPIC -Wno-error=incompatible-pointer-types -Wno-error=stringop-overflow -O0 -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DMAT_FILE=0 -DONESTEPFCN=0 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DTID01EQ=0 -DMODEL=sldemo_mdlref_heat2cost -DNUMST=1 -DNCSTATES=1 -DHAVESTDIO -DRT -DUSE_RTMODEL -I/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988 -I/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_heat2cost -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/extern/include -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/simulink/include -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/rtw/c/src -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/rtw/c/src/ext_mode/common -I/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/_sharedutils -o "sldemo_mdlref_heat2cost.o" "/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_heat2cost/sldemo_mdlref_heat2cost.c" ### Creating static library "./sldemo_mdlref_heat2cost_rtwlib.a" ... ar ruvs ./sldemo_mdlref_heat2cost_rtwlib.a sldemo_mdlref_heat2cost.o ar: `u' modifier ignored since `D' is the default (see `U') ar: creating ./sldemo_mdlref_heat2cost_rtwlib.a a - sldemo_mdlref_heat2cost.o ### Created: "./sldemo_mdlref_heat2cost_rtwlib.a" ### Successfully generated all binary outputs. gmake: Nothing to be done for `all'. ### Successfully updated the model reference code generation target for: sldemo_mdlref_heat2cost ### Starting model reference code generation target build for: sldemo_mdlref_heater ### Build reason: "sldemo_mdlref_heater.c" did not exist. ### Build folder for generated code: /tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_heater ### Invoking Target Language Compiler on sldemo_mdlref_heater.rtw ### Using System Target File: /mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/rtw/c/grt/grt.tlc ### Loading TLC function libraries ....... ### Initial pass through model to cache user defined code . ### Caching model source code ............................................ ### Writing header file sldemo_mdlref_heater_types.h ### Writing header file sldemo_mdlref_heater.h ### Writing header file model_reference_types.h . ### Writing source file sldemo_mdlref_heater.c ### Writing header file sldemo_mdlref_heater_private.h ### TLC code generation complete (took 1.094s). ### Saving binary information cache. ### Using toolchain: GNU gcc/g++ | gmake (64-bit Linux) ### Creating '/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_heater/sldemo_mdlref_heater.mk' ... ### Building 'sldemo_mdlref_heater_rtwlib': "/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/bin/glnxa64/gmake" -j 4 -l 4 -f sldemo_mdlref_heater.mk all gcc -c -fwrapv -fPIC -Wno-error=incompatible-pointer-types -Wno-error=stringop-overflow -O0 -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DMAT_FILE=0 -DONESTEPFCN=0 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DTID01EQ=1 -DMODEL=sldemo_mdlref_heater -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DRT -DUSE_RTMODEL -I/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_F2C -I/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_thermostat -I/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988 -I/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_heater -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/extern/include -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/simulink/include -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/rtw/c/src -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/rtw/c/src/ext_mode/common -I/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/_sharedutils -o "sldemo_mdlref_heater.o" "/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_heater/sldemo_mdlref_heater.c" ### Creating static library "./sldemo_mdlref_heater_rtwlib.a" ... ar ruvs ./sldemo_mdlref_heater_rtwlib.a sldemo_mdlref_heater.o ar: `u' modifier ignored since `D' is the default (see `U') ar: creating ./sldemo_mdlref_heater_rtwlib.a a - sldemo_mdlref_heater.o ### Created: "./sldemo_mdlref_heater_rtwlib.a" ### Successfully generated all binary outputs. gmake: Nothing to be done for `all'. ### Successfully updated the model reference code generation target for: sldemo_mdlref_heater ### Starting model reference code generation target build for: sldemo_mdlref_house ### Build reason: "sldemo_mdlref_house.c" did not exist. ### Build folder for generated code: /tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_house ### Invoking Target Language Compiler on sldemo_mdlref_house.rtw ### Using System Target File: /mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/rtw/c/grt/grt.tlc ### Loading TLC function libraries ....... ### Initial pass through model to cache user defined code . ### Caching model source code .................................................... ### Writing header file sldemo_mdlref_house_types.h . ### Writing header file sldemo_mdlref_house.h ### Writing source file sldemo_mdlref_house.c ### Writing header file sldemo_mdlref_house_private.h ### TLC code generation complete (took 1.031s). ### Saving binary information cache. ### Using toolchain: GNU gcc/g++ | gmake (64-bit Linux) ### Creating '/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_house/sldemo_mdlref_house.mk' ... ### Building 'sldemo_mdlref_house_rtwlib': "/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/bin/glnxa64/gmake" -j 4 -l 4 -f sldemo_mdlref_house.mk all gcc -c -fwrapv -fPIC -Wno-error=incompatible-pointer-types -Wno-error=stringop-overflow -O0 -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DMAT_FILE=0 -DONESTEPFCN=0 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DTID01EQ=0 -DMODEL=sldemo_mdlref_house -DNUMST=1 -DNCSTATES=1 -DHAVESTDIO -DRT -DUSE_RTMODEL -I/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988 -I/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_house -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/extern/include -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/simulink/include -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/rtw/c/src -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/rtw/c/src/ext_mode/common -I/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/_sharedutils -o "sldemo_mdlref_house.o" "/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_house/sldemo_mdlref_house.c" ### Creating static library "./sldemo_mdlref_house_rtwlib.a" ... ar ruvs ./sldemo_mdlref_house_rtwlib.a sldemo_mdlref_house.o ar: `u' modifier ignored since `D' is the default (see `U') ar: creating ./sldemo_mdlref_house_rtwlib.a a - sldemo_mdlref_house.o ### Created: "./sldemo_mdlref_house_rtwlib.a" ### Successfully generated all binary outputs. gmake: Nothing to be done for `all'. ### Successfully updated the model reference code generation target for: sldemo_mdlref_house ### Starting model reference code generation target build for: sldemo_mdlref_outdoor_temp ### Build reason: "sldemo_mdlref_outdoor_temp.c" did not exist. ### Build folder for generated code: /tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_outdoor_temp ### Invoking Target Language Compiler on sldemo_mdlref_outdoor_temp.rtw ### Using System Target File: /mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/rtw/c/grt/grt.tlc ### Loading TLC function libraries ....... ### Initial pass through model to cache user defined code . ### Caching model source code ............................................. ### Writing header file sldemo_mdlref_outdoor_temp_types.h ### Writing header file sldemo_mdlref_outdoor_temp.h . ### Writing source file sldemo_mdlref_outdoor_temp.c ### Writing header file sldemo_mdlref_outdoor_temp_private.h ### TLC code generation complete (took 0.924s). ### Saving binary information cache. ### Using toolchain: GNU gcc/g++ | gmake (64-bit Linux) ### Creating '/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_outdoor_temp/sldemo_mdlref_outdoor_temp.mk' ... ### Building 'sldemo_mdlref_outdoor_temp_rtwlib': "/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/bin/glnxa64/gmake" -j 4 -l 4 -f sldemo_mdlref_outdoor_temp.mk all gcc -c -fwrapv -fPIC -Wno-error=incompatible-pointer-types -Wno-error=stringop-overflow -O0 -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DMAT_FILE=0 -DONESTEPFCN=0 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DTID01EQ=1 -DMODEL=sldemo_mdlref_outdoor_temp -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DRT -DUSE_RTMODEL -I/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_F2C -I/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988 -I/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_outdoor_temp -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/extern/include -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/simulink/include -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/rtw/c/src -I/mathworks/devel/bat/filer/batfs2566-0/Bdoc26b.3351752/build/runnable/matlab/rtw/c/src/ext_mode/common -I/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/_sharedutils -o "sldemo_mdlref_outdoor_temp.o" "/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/slprj/grt/sldemo_mdlref_outdoor_temp/sldemo_mdlref_outdoor_temp.c" ### Creating static library "./sldemo_mdlref_outdoor_temp_rtwlib.a" ... ar ruvs ./sldemo_mdlref_outdoor_temp_rtwlib.a sldemo_mdlref_outdoor_temp.o ar: `u' modifier ignored since `D' is the default (see `U') ar: creating ./sldemo_mdlref_outdoor_temp_rtwlib.a a - sldemo_mdlref_outdoor_temp.o ### Created: "./sldemo_mdlref_outdoor_temp_rtwlib.a" ### Successfully generated all binary outputs. gmake: Nothing to be done for `all'. ### Successfully updated the model reference code generation target for: sldemo_mdlref_outdoor_temp ### Simulink cache artifacts for 'sldemo_mdlref_heat2cost' were created in '/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/sldemo_mdlref_heat2cost.slxc'. ### Simulink cache artifacts for 'sldemo_mdlref_heater' were created in '/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/sldemo_mdlref_heater.slxc'. ### Simulink cache artifacts for 'sldemo_mdlref_house' were created in '/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/sldemo_mdlref_house.slxc'. ### Simulink cache artifacts for 'sldemo_mdlref_outdoor_temp' were created in '/tmp/Bdoc26b_3351752_2847283/tp07e64861/simulink-ex10270988/sldemo_mdlref_outdoor_temp.slxc'. Build Summary Model reference code generation targets: Model Build Reason Status Build Duration ============================================================================================================================== sldemo_mdlref_heat2cost Target (sldemo_mdlref_heat2cost.c) did not exist. Code generated and compiled. 0h 0m 3.0974s sldemo_mdlref_heater Target (sldemo_mdlref_heater.c) did not exist. Code generated and compiled. 0h 0m 3.5311s sldemo_mdlref_house Target (sldemo_mdlref_house.c) did not exist. Code generated and compiled. 0h 0m 2.5943s sldemo_mdlref_outdoor_temp Target (sldemo_mdlref_outdoor_temp.c) did not exist. Code generated and compiled. 0h 0m 2.3329s 4 of 6 models built (2 models already up to date) Build duration: 0h 0m 12.573s ### Searching for referenced models in model 'sldemo_mdlref_depgraph'. ### Total of 5 models to build. ### Model reference simulation target for sldemo_mdlref_thermostat is up to date. ### Model reference simulation target for sldemo_mdlref_F2C is up to date. ### Starting serial model build. ### Starting model reference simulation target build for: sldemo_mdlref_heat2cost ### Successfully updated the model reference simulation target for: sldemo_mdlref_heat2cost ### Starting model reference simulation target build for: sldemo_mdlref_house ### Successfully updated the model reference simulation target for: sldemo_mdlref_house ### Starting model reference simulation target build for: sldemo_mdlref_outdoor_temp ### Successfully updated the model reference simulation target for: sldemo_mdlref_outdoor_temp Build Summary Model reference simulation targets: Model Build Reason Status Build Duration ======================================================================================================================================= sldemo_mdlref_heat2cost Target (sldemo_mdlref_heat2cost_msf.mexa64) did not exist. Code generated and compiled. 0h 0m 3.7481s sldemo_mdlref_house Target (sldemo_mdlref_house_msf.mexa64) did not exist. Code generated and compiled. 0h 0m 3.416s sldemo_mdlref_outdoor_temp Target (sldemo_mdlref_outdoor_temp_msf.mexa64) did not exist. Code generated and compiled. 0h 0m 4.0985s 3 of 5 models built (2 models already up to date) Build duration: 0h 0m 11.947s ### Searching for referenced models in model 'sldemo_mdlref_depgraph'. ### Total of 5 models to build. ### Model reference simulation target for sldemo_mdlref_heat2cost is up to date. ### Model reference simulation target for sldemo_mdlref_thermostat is up to date. ### Model reference simulation target for sldemo_mdlref_house is up to date. ### Model reference simulation target for sldemo_mdlref_F2C is up to date. ### Model reference simulation target for sldemo_mdlref_outdoor_temp is up to date. Build Summary 0 of 5 models built (5 models already up to date) Build duration: 0h 0m 0.42671s
3.指定输出以找到此报告的位置。
reportLocation = upgrader.ReportFile;
4.在分析或升级模型之前配置选项。
默认情况下,
upgradeadvisor会在升级过程中为模型生成备份副本。要关闭备份文件的生成,请设置EnableBackups属性。
upgrader.EnableBackups = false;
要跳过检查,请在升级顾问中右键点击该检查,选择将检查 ID 发送到工作区,并设置
ChecksToSkip属性。
upgrader.ChecksToSkip = {"mathworks.design.SLXModelProperties"};要分析或升级当前模型,而不分析库链接、模型引用或另存为外部模型的测试框架,请启用
OneLevelOnly属性。
upgrader.OneLevelOnly = true;
要分析或升级当前模型和模型引用,但不分析或升级库链接,请启用
SkipLibraries属性。
upgrader.SkipLibraries = true;
要分析和升级模块集或工具箱中的当前模型和文件,请禁用
SkipBlocksets属性。默认情况下,升级顾问不会升级模块集或工具箱中的文件。升级顾问会从ver函数的输出中检测模块集并检测是否存在Contents文件。
upgrader.SkipBlocksets = false;
要在分析或升级模型后不显示报告,请禁用
ShowReport属性。
upgrader.ShowReport = false;
5.升级模型并在自动修复可用时应用它们。
upgrade(upgrader);
(1/2) Upgrading Model "sldemo_mdlref_depgraph" (2/2) Upgrading Model "sldemo_mdlref_depgraph" using compile time information ### Searching for referenced models in model 'sldemo_mdlref_depgraph'. ### Skipped unpacking from Simulink cache file "sldemo_mdlref_heat2cost.slxc" because the relevant build artifacts on disk are up to date. ### Skipped unpacking from Simulink cache file "sldemo_mdlref_heater.slxc" because the relevant build artifacts on disk are up to date. ### Skipped unpacking from Simulink cache file "sldemo_mdlref_F2C.slxc" because the relevant build artifacts on disk are up to date. ### Skipped unpacking from Simulink cache file "sldemo_mdlref_thermostat.slxc" because the relevant build artifacts on disk are up to date. ### Skipped unpacking from Simulink cache file "sldemo_mdlref_house.slxc" because the relevant build artifacts on disk are up to date. ### Skipped unpacking from Simulink cache file "sldemo_mdlref_outdoor_temp.slxc" because the relevant build artifacts on disk are up to date. ### Total of 6 models to build. ### Model reference code generation target for sldemo_mdlref_heat2cost is up to date. ### Model reference code generation target for sldemo_mdlref_F2C is up to date. ### Model reference code generation target for sldemo_mdlref_thermostat is up to date. ### Model reference code generation target for sldemo_mdlref_heater is up to date. ### Model reference code generation target for sldemo_mdlref_house is up to date. ### Model reference code generation target for sldemo_mdlref_outdoor_temp is up to date. Build Summary 0 of 6 models built (6 models already up to date) Build duration: 0h 0m 0.38398s ### Searching for referenced models in model 'sldemo_mdlref_depgraph'. ### Total of 5 models to build. ### Model reference simulation target for sldemo_mdlref_heat2cost is up to date. ### Model reference simulation target for sldemo_mdlref_thermostat is up to date. ### Model reference simulation target for sldemo_mdlref_house is up to date. ### Model reference simulation target for sldemo_mdlref_F2C is up to date. ### Model reference simulation target for sldemo_mdlref_outdoor_temp is up to date. Build Summary 0 of 5 models built (5 models already up to date) Build duration: 0h 0m 0.25484s ### Searching for referenced models in model 'sldemo_mdlref_depgraph'. ### Total of 5 models to build. ### Model reference simulation target for sldemo_mdlref_heat2cost is up to date. ### Model reference simulation target for sldemo_mdlref_thermostat is up to date. ### Model reference simulation target for sldemo_mdlref_house is up to date. ### Model reference simulation target for sldemo_mdlref_F2C is up to date. ### Model reference simulation target for sldemo_mdlref_outdoor_temp is up to date. Build Summary 0 of 5 models built (5 models already up to date) Build duration: 0h 0m 0.24768s
升级顾问会显示已发现问题和自动修复的列表。
升级顾问将修复保存到模型文件中。
相关示例
编程用途
upgradeadvisor("modelname") 为 modelname 指定的模型打开升级顾问。此命令根据需要加载模型,但不会在 Simulink 编辑器中打开模型。使用升级顾问用当前版本中的功能升级和改进模型。
upgrader = upgradeadvisor("modelname") 返回可用于以编程方式分析和升级模型层次结构的对象。如果您指定输出,则升级顾问不会打开。您可以将 analyze 和 upgrade 对象函数与 upgradeadvisor 函数返回的 upgrader 对象结合使用。
要以编程方式分析模型是否适合推荐的升级,请创建
upgrader对象并使用analyze对象函数。要以编程方式分析并升级模型,请创建
upgrader对象并使用upgrade对象函数。要获得升级会话的结果,包括自动解决的问题和需要手动解决的问题数量,请查询
upgrader对象的Summary属性: (自 R2026b 起)upgrader.Summaries
ans = UpgradeSummary with properties: ModelPath: 'C:/Workspace/Documents/MATLAB/Examples/R2026b/simulink/AirframeProjectExample16/airframe/models/AnalogControl.slx' ChecksSkipped: {} ChecksPassed: {1×53 cell} ChecksFailedAndFixed: {} ChecksFailedAndNotFixed: {1×6 cell}有关如何在分析或升级模型之前配置选项的信息,请参阅以编程方式分析和升级模型。
提示
对于没有层次结构的模型,默认情况下,升级顾问会选择并运行除分析模型层次结构并继续升级序列检查之外的所有检查。
对于模型层次结构,使用分析模型层次结构并继续升级序列检查来指导您完成升级检查。您必须按以下顺序运行升级检查:首先运行不需要编译时间信息并且不触发 Update Diagram 的检查,然后运行编译检查。有关详细信息,请参阅分析模型层次结构并继续升级序列。
有关各个升级顾问检查的列表,请参阅模型升级。
有关如何升级整个 MATLAB 工程的示例,请参阅Check for Compatibility Issues and Upgrade Simulink Models Using Project Upgrade。
版本历史记录
在 R2012b 中推出从 R2026b 开始,您可以通过查询 upgrader 对象的 Summary 属性以编程方式获得升级会话的结果。
upgrader = upgradeadvisor("modelname")
upgrader.Summaries
ans =
UpgradeSummary with properties:
ModelPath: 'C:/Workspace/Documents/MATLAB/Examples/R2026b/simulink/AirframeProjectExample16/airframe/models/AnalogControl.slx'
ChecksSkipped: {}
ChecksPassed: {1×53 cell}
ChecksFailedAndFixed: {}
ChecksFailedAndNotFixed: {1×6 cell}MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)