Main Content

sfpref

Set user preferences in Stateflow charts

Description

actionLanguage = sfpref('ActionLanguage') returns the default action language used by Stateflow® charts.

example

sfpref('ActionLanguage',newLanguage) modifies the default action language. See Change the Default Action Language.

correctionSetting = sfpref('EnableLabelAutoCorrectionForMAL') returns if Stateflow automatically corrects common C constructs in charts that use MATLAB® as the action language.

example

sfpref('EnableLabelAutoCorrectionForMAL',newSetting) enables or disables automatic correction of common C constructs in Stateflow charts that use MATLAB as the action language. See Auto Correction When Using MATLAB as the Action Language.

directory = sfpref('PatternWizardCustomDir') returns the directory for custom patterns created using the Stateflow Pattern Wizard.

example

sfpref('PatternWizardCustomDir',newDirectory) modifies the directory for custom patterns created using the Stateflow Pattern Wizard. See Save Custom Flow Chart Patterns.

example

sfpref('showTransitionLabelOwner',newSetting) enables or disables an indicator line between each transition and its associated label.

Examples

collapse all

sfpref('ActionLanguage','C')

Change the action language being used in new Stateflow charts to C.

sfpref('EnableLabelAutoCorrectionForMAL',1)

Enable automatic correction of common C constructs in new Stateflow charts when using MATLAB as the action language.

sfpref('PatternWizardCustomDir','C:\')

Assign the directory for custom patterns created using the Stateflow Pattern Wizard to C:\.

sfpref('showTransitionLabelOwner',1)

Enables an indicator line between each transition and its associated label.

sfpref('showTransitionLabelOwner',0)

Only show indicator between each transition and its associated label if ownership is unclear.

Input Arguments

collapse all

Action language used by Stateflow, specified as 'MATLAB' or 'C'.

Data Types: char

Option to enable or disable the Stateflow setting, specified as 1 or 0. The default value for EnableLabelAutoCorrectionForMAL is 1, and the default value for showTransitionLabelOwner is 0.

Data Types: double

Directory for Stateflow custom patterns created by the Pattern Wizard, specified as a character array.

Data Types: char

Introduced before R2006a