Main Content

ar_0001: Usable characters for file names

Since R2020a

Guideline Publication

Control Algorithm Modeling Guidelines - Using MATLAB®, Simulink®, and Stateflow®

Sub ID Recommendations

  • NA-MAAB — a, b, c, d, e, f, g

  • JMAAB — a, b, c, d, e, f, g

MATLAB Versions

All

Rule

Sub ID a

Only these character types shall be used in file names:

  • Single-byte alphanumeric characters (a-z, A-Z, 0-9)

  • Single-byte underscore (_)

Line breaks, single-byte spaces, double-byte characters, and control characters shall not be used. File types that are checked for model and MATLAB files shall be set in the project settings.

Custom Parameter

File (extension)

Example — Incorrect

MAB Model.slx — Single-byte spaces are used

JMAAB設定.m or NA-MAABModel.p — Double-byte characters are used.

JMAAB(Model).mdl — Symbol characters are used.

Sub ID b

The file name shall not use numbers at the beginning.

Custom Parameter

File (extension)

Example — Incorrect

001_JMAABModel.slx

Sub ID c

The file name shall not use underscores at the beginning.

Custom Parameter

File (extension)

Example — Incorrect

_JMAABModel.slx

Sub ID d

The file name shall not use an underscore at the end.

Custom Parameter

File (extension)

Example — Incorrect

MABModel_.slx

Sub ID e

The file name shall not use consecutive underscores.

Custom Parameter

File (extension)

Example — Incorrect

JMAAB__Model.slx

Sub ID f

The file name shall not consist solely of a single reserved MATLAB word.

Custom Parameter

File (extension)

Example — Incorrect

ans.slx, double.slx

Sub ID g

File names on the MATLAB path shall not be identical.

Custom Parameter

File (extension)

Example — Incorrect

Files with the same name are saved to the folder that goes through the MATLAB path.

Rationale

Sub IDs a, b, c, f:

  • Readability is impaired.

  • Deviation from the rule can cause unexpected issues.

Sub IDs d, e

  • Readability is impaired.

Sub ID g:

  • If there are multiple files with the same name, the one higher on the path is loaded. As a result, unnecessary files might be included.

  • Readability is impaired.

  • Deviation from the rule can cause unexpected issues.

Verification

Model Advisor check: Check file names (Simulink Check)

Last Changed

R2020a

See Also

Version History

Introduced in R2020a