Does syntax checking support undefined variables?

Does matlab support undefined variables like pycharm(fig 1)?The system and software are as follows:window10,matlab r2022b.

답변 (1개)

Hiro Yoshino
Hiro Yoshino 2022년 12월 7일
편집: Hiro Yoshino 2022년 12월 7일

1 개 추천

MATALB automatically identifies problems. Debugging features help you diagnose specific issues, see as follows :
I suppose this function is active by default though.

댓글 수: 4

thank you for response, my matlab software syntax check function does not support undefined variables(fig1), the debugging efficiency is slow because errors are reported only after the script is run.the function to identify undefined variables was not found in code analyzer, How does matlab software syntax check support undefined variables?
Hiro Yoshino
Hiro Yoshino 2022년 12월 7일
편집: Hiro Yoshino 2022년 12월 7일
Sorry, I took it wrong. Let me put it this way....: No, but the problem identifier is "on" by default.
The trouble is that MATLAB never knows if the variable "b" exists in your workspace. So this syntax can be wrong and can be right dependiong on the situation.
For example, you may run a simulation using Simulink models and export something as a variable that would not exist without a run of the simulation. An automatic analysis will be perfomed, once the simulation is over. Your variable "b" is used in the script of this automatic analysis
So this is not a "bug" but a feature.
You can check if your variables exist in the workspace by the method like this.
Thanks for your response

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품

질문:

2022년 12월 7일

댓글:

2022년 12월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by