Upgrade Level-1 Data Classes - MATLAB & Simulink (original) (raw)
Main Content
SimulinkĀ® no longer supports level-1 data classes. You must upgrade data classes that you created using the level-1 data class infrastructure, which was removed in a previous release.
Run the following utility function while specifying the destination folder for the upgraded classes.
Note
Property types defined in level-1 data classes that are not subclasses ofSimulink.Parameter
, Simulink.Signal
, orSimulink.CustomStorageClassAttributes
are not preserved during an upgrade. Only subclasses of these three classes will preserve attributesPropertyType
and AllowedValues
.
- This command upgrades all your level-1 data class packages. You cannot upgrade selected data packages.
Simulink.data.upgradeClasses('C:\MyDataClasses')
Here,C:\MyDataClasses
is the destination folder for your level-2 data classes.
Note
Do not place your upgraded level-2 classes and their equivalent level-1 classes in the same folder.Simulink.data.upgradeClasses
uses thepackagedefn.mat
file in your level-1 class packages for the upgrade and creates level-2 classes in the specified destination folder. Then,Simulink.data.upgradeClasses
adds the folder to top of the MATLABĀ® path and saves the path.
Note
IfSimulink.data.upgradeClasses
cannot save the MATLAB path because of restricted access, a warning appears. In this case, manually add the folder to the top of the MATLAB path and save the path usingsavepath
. - You can change the location of the level-2 package folders after they have been generated. However, you will need to update your MATLAB path so that MATLAB can find these package folders.
- Resave MAT-files and models that contain level-1 data objects.
- Retain your level-1 classes on the MATLAB path until you have resaved all of your models and MAT-files that contain level-1 data objects. Any models or MAT-files that contain level-1 data objects will continue to load successfully while your level-1 data classes are on the MATLAB path.
Note
You cannot use both level-1 and level-2 data classes at the same time. Level-2 classes need to be above the level-1 classes on the MATLAB path so that they are found by MATLAB.
See Also
Simulink.Signal | Simulink.Parameter