Main Content

getSymbols

Get symbols in conditionals

Since R2023b

Description

symbols = getSymbols(conditional) returns the symbols defined in the conditional, conditional.

example

symbols = getSymbols(conditional,name) returns the symbol with the name, name.

example

Examples

collapse all

Open the fault_analyzer_intro model.

openExample('faultanalyzer/FaultAnalyzerIntroExample')

Add a conditional named myConditional to the model, and specify the condition expression as y1+y2 >= 0.

faultConditional = Simulink.fault.addConditional(...
"fault_analyzer_intro","myConditional","y1+y2 >= 0");

Retrieve the symbols defined in the expression.

mySymbols = getSymbols(faultConditional);

Open the fault_analyzer_intro model.

openExample('faultanalyzer/FaultAnalyzerIntroExample')

Add a conditional named myConditional to the model, and specify the condition expression as y1+y2 >= 0.

faultConditional = Simulink.fault.addConditional(...
"fault_analyzer_intro","myConditional","y1+y2 >= 0");

Retrieve the symbol y1.

mySymbols = getSymbols(faultConditional,"y1");

Input Arguments

collapse all

Conditional, specified as a Conditional object.

Name of the symbol used in the condition expression, specified as string scalar or character vector.

Output Arguments

collapse all

Symbols in the condition expression, returned as a Symbol object array.

Version History

Introduced in R2023b