Main Content

addCallback

Add custom callback to Safety Analysis Manager spreadsheets

Since R2024a

Description

addCallback(spreadsheet,callbackName) adds a custom callback to the Safety Analysis Manager spreadsheet, spreadsheet, with the specified name. addCallback creates a custom AnalyzeFcn callback.

example

Examples

collapse all

Create a new spreadsheet in the Safety Analysis Manager.

mySpreadsheet = safetyAnalysisMgr.newSpreadsheet;

Add a custom callback named myCustomCallback to the spreadsheet.

addCallback(mySpreadsheet,"myCustomCallback")

Input Arguments

collapse all

Spreadsheet in the Safety Analysis Manager, specified as a Spreadsheet object.

Callback name, specified as a string scalar or character vector. You must use a name that follows the naming conventions for variables in MATLAB®.

Data Types: char | string

Tips

  • The custom callback that you add does not contain code. To add code to the callback, use the setCallback function.

  • By default, the new custom callback is enabled. Disable or enable the custom callback by using the enableCallback function.

  • To execute the custom callback, enable the callback and use the runAnalysis function.

Version History

Introduced in R2024a