sysobjupdate - Update custom System object to latest syntax - MATLAB (original) (raw)
Main Content
Update custom System object to latest syntax
Since R2020b
Syntax
Description
sysobjupdate [object](#mw%5F5ab0b4e4-acf9-4388-a022-aca1553edf25)
opens the System object™ in the MATLAB® Editor and applies syntax changes without saving.
sysobjupdate [folder](#mw%5F499d7d3f-b33b-4174-8f5d-28b19524f9f2)
opens any System object or objects found in the folder that need updating. The affected objects are opened in the Editor and syntax changes are applied without saving.
sysobjupdate [package](#mw%5F6568204e-d8d2-4d6f-93f3-e40e7bbe1b15)
opens the System object or objects associated with the package in the editor and applies syntax changes without saving.
sysobjupdate ___ -inplace
updates and saves syntax changes to object. No files are opened in the editor, but backup copies of the System object files are created with the suffix _orig.m
. This syntax can be used with any of the previous arguments.
sysobjupdate ___ -inplace -nobackup
performs the updates to the System object in place, but does not create backup copies of the System object files.
sysobjupdate ___ -diff
updates like the-inplace
update argument, but also opens the visdiff tool to compare the changed files.
sysobjupdate ___ -pre [command](#mw%5Fee2ce9a6-30c1-4536-a078-ab4953b18920)
runs a command before updating the System object.
sysobjupdate ___ -post [command](#mw%5Fee2ce9a6-30c1-4536-a078-ab4953b18920)
runs a command after updating the System object.
sysobjupdate ___ -actions [actionKey](#mw%5F7915e01f-edff-41c6-b4e9-16222cc297e9)
applies only the syntax updates listed as actionKey
keywords.
sysobjupdate -listactions
lists all possible actions available for the -actions
option.
[info](#mw%5F60504dd0-8084-46f3-9847-4a29b1bf7151) = sysobjupdate(___)
returns a structure array listing the System object files that were updated and lists warnings for the syntax that was not updated. You can use any of the previous input arguments. Input arguments must be listed as comma-separated character vectors.
Examples
Update the AddOne
System object. If any changes are needed, AddOne
is opened in the MATLAB Editor with the changes applied but not saved.
Update all the System objects in the folderreference
without opening all the objects in MATLAB. After running,sysobjupdate
lists the objects that needed syntax updates.
sysobjupdate C:\Files\reference -inplace
Updated System objects:
digitalDelay analogDelay
Update the Counter
System object in place and also handle the git
version control for theCounter.m
file. An info
structure is returned with the System objects that were updated and with any warning messages resulting from those updates.
info = sysobjupdate('Counter','-inplace','-pre',... 'git add','-post','git commit')
info =
struct with fields:
Class: 'Counter'
Messages: [0×1 string]
Input Arguments
System object or objects to update to the newest System object authoring syntax. The object or folder must be on the MATLAB path.
Example: Counter
Example: C:\Documents\MATLAB\MySystemObjects\Counter.m
Folder of System objects to update to the newest System object authoring syntax. The folder must be on the MATLAB path.
Example: C:\Documents\MATLAB\MySystemObjects
System object package to update to the newest System object authoring syntax. The package or folder must be on the MATLAB path.
Example: +delays
Example: C:\Documents\MATLAB\+delays\
Use this option when you need to run a command before or after updating the System object file.
Running a command is useful when you want to update all your System objects in place with the -inplace
command, but you also need to run version control commands to save the changes to the object.
Example: git add
Example: git commit
Keyword for the -action
option. Use sysobjupdate -listactions
to list all possible action keywords.
Example: ObsoleteMixinRemoval
Output Arguments
A structure of updated files and any warnings encountered for each file during the update.
Version History
Introduced in R2020b