Main Content

sysobjupdate

Update custom System object to latest syntax

Since R2020b

Description

sysobjupdate object opens the System object™ in the MATLAB® Editor and applies syntax changes without saving.

sysobjupdate folder 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 opens the System object or objects associated with the package in the editor and applies syntax changes without saving.

example

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.

example

sysobjupdate ___ -pre command runs a command before updating the System object.

sysobjupdate ___ -post command runs a command after updating the System object.

sysobjupdate ___ -actions actionKey applies only the syntax updates listed as actionKey keywords.

sysobjupdate -listactions lists all possible actions available for the -actions option.

info = 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.

example

Examples

collapse all

Update the AddOne System object. If any changes are needed, AddOne is opened in the MATLAB Editor with the changes applied but not saved.

sysobjupdate AddOne

Update all the System objects in the folder reference 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 the Counter.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

collapse all

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

collapse all

A structure of updated files and any warnings encountered for each file during the update.

Version History

Introduced in R2020b