Documentation

Functions

Alphabetical List By Category

Modeling

Block Libraries

HDL Coder

HDL Operations
hdllibDisplay blocks that are compatible with HDL code generation
HDL Floating Point Operations
hdllibDisplay blocks that are compatible with HDL code generation

Model Editing Fundamentals

simulinkOpen Simulink Start Page
start_simulinkStart Simulink without opening any windows
slLibraryBrowserOpen Simulink Library Browser
new_systemCreate Simulink model or library in memory
open_systemOpen Simulink model, library, subsystem, or block dialog box
load_systemInvisibly load Simulink model
deCreate model or project from template
Simulink.findTemplatesFind model or project templates with specified properties
Simulink.defaultModelTemplateSet or get default model template
add_blockAdd block to model
add_lineAdd line to Simulink model
replace_blockReplace blocks in Simulink model
delete_blockDelete blocks from Simulink system
delete_lineDelete line from Simulink model
bdrootReturn name of top-level Simulink system
find_systemFind systems, blocks, lines, ports, and annotations
gcsGet pathname of current system
getfullnameGet pathname of block or line
gcbGet path name of current block
gcbhGet handle of current block
getSimulinkBlockHandleGet block handle from block path
set_paramSet system and block parameter values
get_paramGet parameter names and values
add_paramAdd parameter to Simulink system
delete_paramDelete system parameter added via add_param command
Simulink.BlockDiagram.createSubsystemCreate subsystem containing specified set of blocks
Simulink.BlockDiagram.deleteContentsDelete contents of block diagram
Simulink.BlockDiagram.expandSubsystemExpand subsystem contents to containing model level
Simulink.SubSystem.copyContentsToBlockDiagramCopy contents of subsystem to empty block diagram
Simulink.SubSystem.deleteContentsDelete contents of subsystem
save_systemSave Simulink system
close_systemClose Simulink system window or block dialog box
Simulink.exportToTemplateCreate template from model or project
Simulink.exportToVersionExport model or library for use in previous version of Simulink
bdcloseClose any or all Simulink system windows unconditionally
bdIsLoadedWhether block diagram is in memory
bdIsLibraryWhether block diagram is a library
bdIsDirtyWhether block diagram has unsaved changes
slCharacterEncodingChange MATLAB character set encoding
slIsFileChangedOnDiskDetermine whether model has changed since it was loaded
printPrint figure or save to specific file format
orientPaper orientation for printing or saving
frameeditEdit print frames for Simulink and Stateflow block diagrams

Design Models

Model Hierarchy

Simulink.BlockDiagram.createSubsystemCreate subsystem containing specified set of blocks
Simulink.BlockDiagram.copyContentsToSubsystemCopy contents of block diagram to empty subsystem
Simulink.SubSystem.convertToModelReferenceConvert subsystem to model reference
Simulink.SubSystem.copyContentsToBlockDiagramCopy contents of subsystem to empty block diagram
Simulink.SubSystem.deleteContentsDelete contents of subsystem
Simulink.BlockDiagram.expandSubsystemExpand subsystem contents to containing model level
Simulink.SubSystem.getChecksumReturn checksum of nonvirtual subsystem

Nonlinearity

Simulink.LookupTableStore and share lookup table and breakpoint data, configure the data for ASAP2 and AUTOSAR code generation
Simulink.BreakpointStore and share data for a breakpoint set, configure the data for ASAP2 and AUTOSAR code generation
Simulink.lookuptable.EvenspacingConfigure even spacing set data for lookup table object
Simulink.lookuptable.TableConfigure table data for lookup table object
Simulink.lookuptable.BreakpointConfigure breakpoint set data for lookup table object
Simulink.lookuptable.StructTypeInfoConfigure settings for structure type that lookup table object uses in the generated code

Multicore Processor Targets

Simulink.architecture.configCreate or convert configuration for concurrent execution
Simulink.architecture.addAdd tasks or triggers to selected architecture of model
Simulink.architecture.deleteDelete triggers and tasks from selected architecture of model
Simulink.architecture.find_systemFind objects under architecture object
Simulink.architecture.get_paramGet configuration parameters of architecture objects
Simulink.architecture.importAndSelectImport and select target architecture for concurrent execution environment for model
Simulink.architecture.profileGenerate profile report for model configured for concurrent execution
Simulink.architecture.registerAdd custom target architecture to concurrent execution target architecture selector
Simulink.architecture.set_paramSet architecture object properties
Simulink.GlobalDataTransferConfigure concurrent execution data transfers

Configure Models

Blocks

set_paramSet system and block parameter values
get_paramGet parameter names and values
Simulink.DualScaledParameter Specify name, value, units, and other properties of Simulink dual-scaled parameter
Simulink.ParameterStore, share, and configure block parameter values

Signals

disableimplicitsignalresolutionConvert model to use only explicit signal resolution
signalbuilderCreate and access Signal Builder blocks
Simulink.SignalSpecify attributes of signal

Variables

getVariableGet value of variable from workspace
hasVariableDetermine if variable exists in workspace
Simulink.findVarsAnalyze relationship between variables and blocks in models
matlab.io.saveVariablesToScriptSave workspace variables to MATLAB script
Simulink.data.evalinGlobalEvaluate MATLAB expression in context of Simulink model
Simulink.data.assigninGlobalModify variable values in context of Simulink model
Simulink.data.existsInGlobalCheck existence of variable in context of Simulink model
Simulink.data.dictionary.createCreate new data dictionary and create Simulink.data.Dictionary object
Simulink.data.dictionary.openOpen data dictionary for editing
Simulink.data.dictionary.cleanupWorkerCacheRestore defaults after parallel simulation with data dictionary
Simulink.data.dictionary.setupWorkerCacheEnable parallel simulation with data dictionary
Simulink.data.dictionary.getOpenDictionaryPathsReturn file names and paths of open data dictionaries
Simulink.data.dictionary.closeAllClose all connections to all open data dictionaries
Simulink.ModelWorkspaceDescribe model workspace
Simulink.WorkspaceVar Contains information about workspace variables and blocks that use them
Simulink.VariableUsageStore information about the relationship between variables and blocks in models
Simulink.CoderInfo Specify information needed to generate code for signal or parameter data
Simulink.data.DictionaryConfigure data dictionary
Simulink.data.dictionary.SectionConfigure data dictionary section
Simulink.data.dictionary.EntryConfigure data dictionary entry
Simulink.data.dictionary.EnumTypeDefinitionStore enumerated type definition in data dictionary

Sample Time

Simulink.BlockDiagram.getSampleTimesReturn all sample times associated with model
Simulink.Block.getSampleTimesReturn sample time information for a block
Simulink.SampleTimeObject containing sample time information
Simulink.BlockPortDataDescribe block input or output port

Data Types

enumerationDisplay class enumeration members and names
Simulink.defineIntEnumTypeDefine enumerated data type
Simulink.data.getEnumTypeInfoGet information about enumerated data type
fixdtCreate Simulink.NumericType object describing fixed-point or floating-point data type
fixpt_evenspace_cleanupModify breakpoints of lookup table to have even spacing
fixpt_interp1Implement 1-D lookup table
fixpt_look1_func_approxOptimize fixed-point approximation of nonlinear function by interpolating lookup table data points
fixpt_look1_func_plotPlot fixed-point approximation function for lookup table
fixpt_set_allSet property for each fixed-point block in subsystem
fixptbestexpExponent that gives best precision for fixed-point representation of value
fixptbestprecDetermine maximum precision available for fixed-point representation of value
floatCreate Simulink.NumericType object describing floating-point data type
fxptdlgStart Fixed-Point Tool
num2fixptConvert number to nearest value representable by specified fixed-point data type
sfixCreate Simulink.NumericType object describing signed fixed-point data type
sfracCreate Simulink.NumericType object describing signed fractional data type
sintCreate Simulink.NumericType object describing signed integer data type
Simulink.importExternalCTypesGenerate Simulink representations of custom data types defined by C or C++ code
tunablevars2parameterobjectsCreate Simulink parameter objects from tunable parameters
ufixCreate Simulink.NumericType object describing unsigned fixed-point data type
ufracCreate Simulink.NumericType object describing unsigned fractional data type
uintCreate Simulink.NumericType object describing unsigned integer data type
Simulink.AliasType Create alias for signal and parameter data type
Simulink.NumericTypeSpecify floating point, integer, or fixed point data type

Model, Block, and Port Callbacks

set_paramSet system and block parameter values
get_paramGet parameter names and values
getCallbackAnnotationGet annotation executing callback
Simulink.AnnotationSpecify properties of model annotation

Annotate Models

add_blockAdd block to model
docblockGet or set editor invoked by Simulink DocBlock
hilite_systemHighlight block, signal line, port, or annotation
getCallbackAnnotationGet annotation executing callback
Simulink.AnnotationSpecify properties of model annotation

Transform Models

Discretization

slmdldiscuiOpen Model Discretizer GUI
sldiscmdlDiscretize model that contains continuous blocks

Trimming and Linearization

trimFind trim point of dynamic system
dlinmodExtract discrete-time linear state-space model around operating point
linmodExtract continuous-time linear state-space model around operating point
linmod2Extract continuous-time linear state-space model around operating point
linmodv5Extract continuous-time linear state-space model around operating point
Simulink.BlockDiagram.getInitialStateReturn initial state data of block diagram

Fixed Point

fxptdlgStart Fixed-Point Tool
fixdtCreate Simulink.NumericType object describing fixed-point or floating-point data type
fixpt_look1_func_approxOptimize fixed-point approximation of nonlinear function by interpolating lookup table data points
fixpt_evenspace_cleanupModify breakpoints of lookup table to have even spacing
fixpt_interp1Implement 1-D lookup table
fixpt_look1_func_plotPlot fixed-point approximation function for lookup table
fixpt_set_allSet property for each fixed-point block in subsystem
fixptbestexpExponent that gives best precision for fixed-point representation of value
fixptbestprecDetermine maximum precision available for fixed-point representation of value
floatCreate Simulink.NumericType object describing floating-point data type
num2fixptConvert number to nearest value representable by specified fixed-point data type
sfixCreate Simulink.NumericType object describing signed fixed-point data type

Run Model Checks

modeladvisorOpen Model Advisor
Simulink.ModelAdvisorRun Model Advisor from MATLAB file
ModelAdvisor.PreferencesSet Model Advisor window preferences by specifying which folders and tabs to display

Diagnostics

sldiagnosticsDisplay diagnostic information about Simulink system
Simulink.restoreDiagnosticRestore diagnostic warnings to a specific block, subsystem, or model
Simulink.suppressDiagnosticSuppress a diagnostic from a specific block
Simulink.getSuppressedDiagnostics Return Simulink.SuppressedDiagnostic objects associated with a block, subsystem, or model
Simulink.SuppressedDiagnosticSuppress diagnostic messages from a specified block

Simulation

Prepare Model Inputs and Outputs

Load Signal Data for Simulation

getRootInportMapCreate custom object to map signals to root-level inports
convertToSlDatasetConvert contents of MAT-file to Simulink.SimulationData.Dataset object
getSlRootInportMapCreate custom object to map signals to root-level inports using Simulink mapping mode
createInputDatasetGenerate dataset object for root-level Inport blocks in model
signalbuilderCreate and access Signal Builder blocks
getInputStringCreate comma-separated list of variables to map
Simulink.BlockDiagram.getInitialStateReturn initial state data of block diagram
Simulink.Bus.createMATLABStructCreate MATLAB structures using same hierarchy and attributes as bus signals
Simulink.SimulationData.createStructOfTimeseriesCreate a structure with MATLAB timeseries object leaf nodes
signalEditorStart Signal Editor

Save Runtime Data from Simulation

Simulink.ModelDataLogs.convertToDatasetConvert logging data from Simulink.ModelDataLogs format to Simulink.SimulationData.Dataset format
Simulink.SimulationData.signalLoggingSelectorOpen Signal Logging Selector
Simulink.SimulationData.updateDatasetFormatLoggingConvert model and its referenced models to use Dataset format for signal logging
unpackExtract signal logging objects from signal logs and write them into MATLAB workspace
Simulink.SimulationData.createStructOfTimeseriesCreate a structure with MATLAB timeseries object leaf nodes
Simulink.SimulationData.forEachTimeseriesCall function on each timeseries object
Simulink.SimulationData.Unit.setNameSpecify name of logging data units
Simulink.SimulationData.DatasetRef.getDatasetVariableNamesList names of Dataset variables in MAT-file
Simulink.SimulationData.DatasetRef.getAsDatastoreGet matlab.io.datastore.SimulationDatastore representation of element from referenced Dataset object
whoList names of top-level data logging objects in Simulink ModelDataLogs data log
whosList names and types of top-level data logging objects in Simulink ModelDataLogs data log
Simulink.SimulationData.DatasetCreate Simulink.SimulationData.Dataset object
Simulink.SimulationData.DatasetRefCreate Simulink.SimulationData.DatasetRef object
matlab.io.datastore.SimulationDatastoreDatastore for inputs and outputs of Simulink models
Simulink.SimulationData.BlockPathFully specified Simulink block path
Simulink.SimulationData.SignalContainer for signal logging information
Simulink.SimulationData.StateState logging element
Simulink.SimulationData.UnitStore units for simulation data
Simulink.SimulationOutputAccess object values of simulation results
Simulink.SimulationData.LoggingInfoSignal logging override settings
Simulink.SimulationData.ModelLoggingInfoSignal logging override settings for a model
Simulink.SimulationData.SignalLoggingInfoSignal logging override settings for signal
Simulink.SimulationMetadataAccess metadata of simulation runs

Configure Simulation Conditions

openDialogOpen configuration parameters dialog
closeDialogClose configuration parameters dialog
solverprofiler.profileModelExamine model for performance analysis

Run Simulations

Run Individual Simulations Programmatically

simSimulate dynamic system
modelExecute particular phase of simulation of model
find Access and display values of simulation results
get Access and display values of simulation results
whoList names of top-level data logging objects in Simulink ModelDataLogs data log
set_paramSet system and block parameter values
get_paramGet parameter names and values
getInitialStateReturn initial state data of block diagram
setBlockSimState Set SimState of individual Stateflow Chart, MATLAB Function, or S-function block
getBlockSimState Access SimState of individual Stateflow Chart, MATLAB Function, or S-function block
add_exec_event_listenerRegister listener for block method execution event
Simulink.SimState.ModelSimState Access SimState snapshot data
eventDataProvide information about block method execution events

Run Multiple Simulations

parsimSimulate dynamic system in parallel or serial
applyToModelApply changes to the model specified through a SimulationInput object, in
setBlockParameterSet block parameters to be used for a specific simulation through SimulationInput object, in
setModelParameterSet model parameters to be used for a specific simulation through SimulationInput object, in
setInitialStateSet initial state to be used for a specific simulation through SimulationInput object, in
ExternalInputSet external inputs for a simulation through SimulationInput object, in
setVariableSet variables for a simulation through SimulationInput object, in
validateValidate the contents of the SimulationInput object, in
PreSimFcnSpecify a MATLAB function to run before start of each simulation through SimulationInput object, in
PostSimFcn Specify a MATLAB function to run after each simulation is complete through SimulationInput object, in
Simulation ManagerMonitor multiple simulations in one window
Simulink.SimulationInputCreates SimulationInput objects to make changes to a model for multiple or individual simulations

View and Analyze Simulation Results

Inspect and Analyze Simulation Results

find Access and display values of simulation results
get Access and display values of simulation results
whoList names of top-level data logging objects in Simulink ModelDataLogs data log
Simulink.sdi.viewOpen the Simulation Data Inspector
Simulink.sdi.closeClose the Simulation Data Inspector
Simulink.sdi.setSubPlotLayoutSet subplot layout in the Simulation Data Inspector
Simulink.sdi.setTableGroupingChange signal grouping hierarchy in Inspect pane
Simulink.sdi.getMarkersOnReturn logical indication of marker property
Simulink.sdi.setMarkersOnControl whether markers are shown
Simulink.sdi.clearPreferencesClear Simulation Data Inspector preference changes
Simulink.sdi.enablePCTSupportControl how the Simulation Data Inspector works with the Parallel Computing Toolbox
Simulink.sdi.isPCTSupportEnabledDetermine status for Parallel Computing Toolbox support
Simulink.sdi.cleanupWorkerResourcesClean up worker repositories
Simulink.sdi.compareRunsCompare the data in two simulation runs
Simulink.sdi.compareSignalsCompare data from two signals
Simulink.sdi.getRunGet a Simulink.sdi.Run object containing simulation output data
Simulink.sdi.copyRunCreate a copy of a run
Simulink.sdi.deleteRunDelete a run from the Simulation Data Inspector
Simulink.sdi.createRunCreate a run in the Simulation Data Inspector
Simulink.sdi.getRunNamingRuleGet the run naming rule for Simulation Data Inspector runs
Simulink.sdi.setRunNamingRuleSpecify a run naming rule
Simulink.sdi.resetRunNamingRuleReset the Simulation Data Inspector run naming rule to the default
Simulink.sdi.setRunOverwriteEnable overwrite run mode for a Simulation Data Inspector run
Simulink.sdi.getRunCountGet the number of runs in the Simulation Data Inspector
Simulink.sdi.getRunIDByIndexGet the run ID corresponding to the specified run index
Simulink.sdi.getAllRunIDs Get all run identifiers within the Simulation Data Inspector
Simulink.sdi.isValidRunIDDetermine if run ID is valid
Simulink.sdi.copyRunViewSettingsCopy signal line style and color specifications from one run to another run
Simulink.sdi.createRunOrAddToStreamedRun Create a single run for all simulation outputs
Simulink.sdi.getSignalGet a Simulink.sdi.Signal object for the specified signal in the Simulation Data Inspector
Simulink.sdi.deleteSignalDelete a signal from the Simulation Data Inspector
Simulink.sdi.addToRunAdd data to existing run
Simulink.sdi.markSignalForStreamingTurn streaming on or off for a signal
Simulink.sdi.saveSave current Simulation Data Inspector session
Simulink.sdi.loadLoad a saved Simulation Data Inspector session or view
Simulink.sdi.clearClear all data from the Simulation Data Inspector
Simulink.sdi.exportRun Create a Simulink.SimulationData.Dataset object of the data in the specified run
Simulink.sdi.reportGenerate a Simulation Data Inspector report
loadIntoMemoryLoad logged data into memory
Simulink.sdi.DiffRunResultAccess run comparison metadata
Simulink.sdi.DiffSignalResultAccess signal comparison results
Simulink.sdi.RunAccess run signals and metadata
Simulink.sdi.Signal Access signal data and metadata
Simulink.sdi.WorkerRun Access simulation data from parallel workers
Simulink.SimulationData.DatasetCreate Simulink.SimulationData.Dataset object
Simulink.sdi.DatasetRefAccess data in Simulation Data Inspector repository
matlab.io.datastore.sdidatastore Datastore for Simulation Data Inspector signals
Simulink.HMI.InstrumentedSignalsAccess logged signals in model
Simulink.HMI.SignalSpecificationInformation for logging a signal

Control Simulations with Interactive Displays

Simulink.HMI.InstrumentedSignalsAccess logged signals in model
Simulink.HMI.SignalSpecificationInformation for logging a signal

Test and Debug Simulations

Simulink Debugger

sldebugStart simulation in debug mode

Diagnostics

sldiagnosticsDisplay diagnostic information about Simulink system
Simulink.restoreDiagnosticRestore diagnostic warnings to a specific block, subsystem, or model
Simulink.suppressDiagnosticSuppress a diagnostic from a specific block
Simulink.getSuppressedDiagnostics Return Simulink.SuppressedDiagnostic objects associated with a block, subsystem, or model
Simulink.BlockDiagram.getChecksumReturn checksum of model
Simulink.SubSystem.getChecksumReturn checksum of nonvirtual subsystem
Simulink.getSuppressedDiagnostics Return Simulink.SuppressedDiagnostic objects associated with a block, subsystem, or model
Simulink.suppressDiagnosticSuppress a diagnostic from a specific block
Simulink.restoreDiagnosticRestore diagnostic warnings to a specific block, subsystem, or model
modeladvisorOpen Model Advisor
sldebugStart simulation in debug mode
addtermsAdd terminators to unconnected ports in model
Simulink.SuppressedDiagnosticSuppress diagnostic messages from a specified block

Performance

Automated Performance Optimization

performanceadvisorOpen Performance Advisor

Acceleration

simSimulate dynamic system
set_paramSet system and block parameter values
Simulink.BlockDiagram.buildRapidAcceleratorTargetBuild Rapid Accelerator target for model and return run-time parameter set
Simulink.BlockDiagram.getChecksumReturn checksum of model
Simulink.SubSystem.getChecksumReturn checksum of nonvirtual subsystem
slbuildBuild standalone executable or model reference target for model; except where noted, this function requires a Simulink Coder license

Manual Performance Optimization

slprofreportRegenerate profiler report from data, ProfileData, saved from previous run
sldiagnosticsDisplay diagnostic information about Simulink system

Component-Based Modeling

Model Architecture

Subsystems

Simulink.BlockDiagram.createSubsystemCreate subsystem containing specified set of blocks
Simulink.BlockDiagram.copyContentsToSubsystemCopy contents of block diagram to empty subsystem
Simulink.BlockDiagram.expandSubsystemExpand subsystem contents to containing model level
Simulink.SubSystem.convertToModelReferenceConvert subsystem to model reference
Simulink.SubSystem.copyContentsToBlockDiagramCopy contents of subsystem to empty block diagram
Simulink.SubSystem.deleteContentsDelete contents of subsystem

Libraries

libinfoGet information about library blocks referenced by model
gcbGet path name of current block
gcbhGet handle of current block
LibraryBrowser.LibraryBrowser2Simulink Library Browser

Model Referencing

find_mdlrefsFind Model blocks and referenced models at all levels or at top level only
view_mdlrefsDisplay graph of model reference dependencies
Simulink.SubSystem.convertToModelReferenceConvert subsystem to model reference
slbuildBuild standalone executable or model reference target for model; except where noted, this function requires a Simulink Coder license

Data Stores

Simulink.SimulationData.DataStoreMemoryContainer for data store logging information
Simulink.SimulationData.BlockPathFully specified Simulink block path
Simulink.SimulationData.DatasetCreate Simulink.SimulationData.Dataset object

Composite Signals

Simulink.BlockDiagram.addBusToVectorConvert virtual bus signals into vector signals by adding Bus to Vector blocks
Simulink.Bus.cellToObjectConvert cell array containing bus information to bus objects
Simulink.Bus.createMATLABStructCreate MATLAB structures using same hierarchy and attributes as bus signals
Simulink.Bus.createObjectCreate bus objects from blocks or MATLAB structures
Simulink.Bus.objectToCellUse bus objects to create cell array containing bus information
Simulink.Bus.saveSave bus objects in MATLAB file
Simulink.Bus Specify properties of bus signal
Simulink.BusElement Describe element of bus signal

Configuration Reuse

attachConfigSetAssociate configuration set or configuration reference with model
attachConfigSetCopyCopy configuration set or configuration reference and associate it with model
detachConfigSetDissociate configuration set or configuration reference from model
getActiveConfigSetGet model's active configuration set or configuration reference
getConfigSetGet one of model's configuration sets or configuration references
getConfigSetsGet names of all of model's configuration sets or configuration references
setActiveConfigSetSpecify model's active configuration set or configuration reference
Simulink.BlockDiagram.loadActiveConfigSetLoad, associate, and activate configuration set with model
Simulink.BlockDiagram.propagateConfigSetPropagate top model configuration reference to referenced models
Simulink.BlockDiagram.restoreConfigSetRestore model configuration for converted models
Simulink.BlockDiagram.saveActiveConfigSetSave active configuration set of model
set_paramSet system and block parameter values
get_paramGet parameter names and values
Simulink.ConfigSetModel configuration set
Simulink.ConfigSetRefLink model to configuration set stored independently of any model

Variant Systems

Simulink.VariantSpecify conditions that control variant selection
Simulink.VariantConfigurationDataClass representing a variant configurations data object
Simulink.VariantManagerClass representing a set of Variant Manager functionality

Project Management

Simulink Project Setup

simulinkprojectOpen Simulink Project and get project object
slproject.createCreate blank Simulink project
Simulink.createFromTemplateCreate model or project from template
Simulink.findTemplatesFind model or project templates with specified properties
Simulink.exportToTemplateCreate template from model or project
slproject.getCurrentProjectsList all top-level Simulink projects
slproject.loadProjectLoad Simulink project
exportExport Simulink Project to zip
closeClose Simulink Project
addFileAdd file to Simulink Project
addFolderIncludingChildFilesAdd folder and child files to Simulink Project
addPathAdd folder to path of Simulink project
addReferenceAdd referenced project to Simulink project
addShortcutAdd shortcut to Simulink project
addShutdownFileAdd shutdown file to project
addStartupFileAdd startup file to project
findFileGet Simulink Project file by name
isLoadedDetermine if Simulink Project is loaded
reloadReload Simulink Project
removeFileRemove file from Simulink Project
removePathRemove folder from Simulink project path
removeReferenceAdd folder to Simulink project path
removeShortcutRemove shortcut from Simulink project
removeShutdownFile​Remove shutdown file from project shutdown list
removeStartupFileRemove startup file from project startup list

Simulink Project File Management

simulinkprojectOpen Simulink Project and get project object
slproject.loadProjectLoad Simulink project
slproject.getCurrentProjectsList all top-level Simulink projects
addFileAdd file to Simulink Project
addFolderIncludingChildFilesAdd folder and child files to Simulink Project
addLabelAttach label to Simulink Project file
addPathAdd folder to path of Simulink project
addReferenceAdd referenced project to Simulink project
addShortcutAdd shortcut to Simulink project
closeClose Simulink Project
createCategoryCreate category of Simulink Project labels
createLabelDefine Simulink Project label
exportExport Simulink Project to zip
findCategoryGet Simulink Project category of labels
findFileGet Simulink Project file by name
findLabelGet Simulink Project file label
isLoadedDetermine if Simulink Project is loaded
reloadReload Simulink Project
removeCategoryRemove Simulink Project category of labels
removeLabelRemove label from Simulink Project

Dependency Analysis

simulinkprojectOpen Simulink Project and get project object
listRequiredFilesGet project file dependencies
dependencies.fileDependencyAnalysisFind model file dependencies
dependencies.toolboxDependencyAnalysisFind toolbox dependencies

Source Control in Simulink Project

simulinkprojectOpen Simulink Project and get project object
listModifiedFilesList modified files in Simulink project
listRequiredFilesGet project file dependencies
refreshSourceControlUpdate source control status of Simulink project files
Simulink.getFileChecksumChecksum of file

Model Exploration

find_systemFind systems, blocks, lines, ports, and annotations
find_mdlrefsFind Model blocks and referenced models at all levels or at top level only
Simulink.findVarsAnalyze relationship between variables and blocks in models
dependencies.fileDependencyAnalysisFind model file dependencies
dependencies.toolboxDependencyAnalysisFind toolbox dependencies
Simulink.MDLInfoExtract model file information without loading block diagram into memory
Simulink.MDLInfo.getDescriptionExtract model file description without loading block diagram into memory
Simulink.MDLInfo.getMetadataExtract model file metadata without loading block diagram into memory
LibraryBrowser.LibraryBrowser2Simulink Library Browser

Modeling Guidelines

Model Upgrades

upgradeadvisorOpen Upgrade Advisor

Block Creation

Block Masks

Simulink.MaskControl masks programmatically
Simulink.MaskParameterControl mask parameters programmatically
Simulink.dialog.ControlCreate instances of dialog control

Custom MATLAB Algorithms

MATLAB Algorithm Design

Algorithm Design Basics
coder.allowpcodeControl code generation from protected MATLAB files
coder.cevalCall external C/C++ function
coder.cincludeInclude header file in generated code
coder.cstructnameName structure in generated code
coder.extrinsicDeclare extrinsic function or functions
coder.inlineControl inlining in generated code
coder.loadLoad compile-time constants from MAT-file or ASCII file into caller workspace
coder.nullcopyDeclare uninitialized variables
coder.opaqueDeclare variable in generated code
coder.refPass argument by reference
coder.rrefPass argument by reference as read-only input
coder.targetDetermine if code generation target is specified target
coder.unrollUnroll for-loop by making a copy of the loop body for each loop iteration
coder.varsizeDeclare variable-size array
coder.wrefPass argument as write-only reference
Data Definition
Variable-Size Data
coder.varsizeDeclare variable-size array
Structures
coder.cstructnameName structure in generated code
Cell Arrays
coder.cstructnameName structure in generated code
coder.varsizeDeclare variable-size array
Function Definition
coder.extrinsicDeclare extrinsic function or functions
coder.ignoreConstPrevent use of constant value of expression for function specializations
coder.unrollUnroll for-loop by making a copy of the loop body for each loop iteration

Code Generation

coder.allowpcodeControl code generation from protected MATLAB files
coder.cevalCall external C/C++ function
coder.cincludeInclude header file in generated code
coder.constFold expressions into constants in generated code
coder.cstructnameName structure in generated code
coder.extrinsicDeclare extrinsic function or functions
coder.inlineControl inlining in generated code
coder.loadLoad compile-time constants from MAT-file or ASCII file into caller workspace
coder.opaqueDeclare variable in generated code
coder.refPass argument by reference
coder.rrefPass argument by reference as read-only input
coder.screenerDetermine if function is suitable for code generation
coder.targetDetermine if code generation target is specified target
coder.unrollUnroll for-loop by making a copy of the loop body for each loop iteration
coder.wrefPass argument as write-only reference
coder.updateBuildInfoUpdate build information object RTW.BuildInfo
coder.ExternalDependencyInterface to external code
coder.BuildConfigBuild context during code generation

Performance

coder.inlineControl inlining in generated code
coder.unrollUnroll for-loop by making a copy of the loop body for each loop iteration
coder.constFold expressions into constants in generated code

Legacy Code Integration

legacy_codeUse Legacy Code Tool

S-Functions

C/C++ S-Functions

S-Function Checks
Simulink.sfunction.AnalyzerCreate a Simulink S-function analyzer object
Simulink.sfunction.analyzer.BuildInfo Create an object to represent build information
Simulink.sfunction.analyzer.Options Create an object to specify options for running S-function checks

MATLAB S-Functions

Simulink.MSFcnRunTimeBlockGet run-time information about Level-2 MATLAB S-function block
Simulink.RunTimeBlockAllow Level-2 MATLAB S-function and other MATLAB programs to get information about block while simulation is running
Simulink.BlockDataProvide run-time information about block-related data, such as block parameters
Simulink.BlockPortDataDescribe block input or output port
Simulink.BlockCompDworkDataProvide postcompilation information about block's DWork vector
Simulink.BlockCompInputPortDataProvide postcompilation information about block input port
Simulink.BlockCompOutputPortDataProvide postcompilation information about block output port
Simulink.BlockPreCompInputPortDataProvide precompilation information about block input port
Simulink.BlockPreCompOutputPortDataProvide precompilation information about block output port

System Object Integration

Customize System Objects for Simulink

matlab.system.mixin.CustomIconCustom icon mixin class
matlab.system.display.IconCustom icon image
matlab.system.display.ActionCustom button
matlab.system.display.HeaderHeader for System objects properties
matlab.system.display.SectionProperty group section for System objects
matlab.system.display.SectionGroupSection group for System objects
matlab.system.mixin.PropagatesSignal characteristics propagation mixin class
matlab.system.mixin.NondirectNondirect feedthrough mixin class
matlab.system.mixin.SampleTimeControl sample time for System objects in Simulink
Was this topic helpful?