code analyzer bar not indicating syntax errors

Code analyzer bar not indicating syntax errors.
clear on line 3 is mispelled but there is a green box in the code analyzer bar???
An error results in the command window when this code is run.
The code analyzer is enabled in Preferences.
I believe this has recognized this type of systax error in earlier editions.
Jack Koscinski

 Accepted Answer

There are some problems that Code Analyzer's static analysis can detect, but a misspelled function name is not always something it can detect. [If you misspell it badly enough, like misspelling the x2fx function from Statistics and Machine Learning Toolbox as 2fx which is not a valid function name, Code Analyzer can detect it.] You intended that line to call the clear function, but how can you know just by looking at that file (static analysis) that there's no function named clea that is being called?

More Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Products

Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!