Main Content

slImportFavoriteCommands

Import favorite commands to Simulink quick access toolbar

Description

example

backup = slImportFavoriteCommands(file) imports favorite commands and categories from the specified file to the Simulink® Favorite Commands gallery. The specified file must be generated by exporting the contents of a Simulink Favorite Commands gallery using slExportFavoriteCommands.

example

backup = slImportFavoriteCommands(file,'overwrite') overwrites the contents of the Simulink Favorite Commands gallery with the contents of the specified file. The specified file must be generated by exporting the contents of a Simulink Favorite Commands gallery using slExportFavoriteCommands.

Examples

collapse all

Suppose a team member shares a file that contains favorite commands you want to use in Simulink, and you want to merge the file contents with the contents of your Simulink Favorite Commands gallery.

In the MATLAB® Command Window, enter this command:

slImportFavoriteCommands('B:\path\slFavorites.mat');

Suppose a team member shares a file that contains favorite commands you want to use in Simulink, and you want to overwrite the contents of your Simulink Favorite Commands gallery with the file contents.

In the MATLAB Command Window, enter this command:

slImportFavoriteCommands('B:\path\slFavorites.mat','overwrite');

Input Arguments

collapse all

File name or path, specified as a character vector or string scalar.

Example: slImportFavoriteCommands('B:\path\slFavorites.mat')

Data Types: char | string

Output Arguments

collapse all

Path to backup of previous state, returned as a character vector.

To restore the previous state, you can pass the returned value as the input to the function and overwrite the current state.

Version History

Introduced in R2021b