How can I use increment value for entire script instead of section?

조회 수: 1 (최근 30일)
Kyle Smith
Kyle Smith 2014년 12월 1일
편집: Cris LaPierre 2024년 10월 28일
I have a large script that contains many sections (%%) that I would like to run using the "increment value and run section." However, I am interested in running the entire script, not just a section. Is there a way to change the way the "increment value" works? Currently, I can make it work but simply removing all the %% in my script so MATLAB reads the script as one giant section. This is annoy to do.
Any help would be much appreciated!
Thanks!
  댓글 수: 1
埃博拉酱
埃博拉酱 2024년 10월 26일
What is "increment value and run section" ? I've never heard of this function.

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

답변 (1개)

Cris LaPierre
Cris LaPierre 2024년 10월 28일
편집: Cris LaPierre 2024년 10월 28일
It is not possible to modify the behavior.of this feature.
If I were in your position, my workaround would to leave the sections as they are and add a debugging flag to the top of the script with an if statement that incrments the variable if it exists in the Workspace. When the debugging flag is set to true, the code in the if statement executes (when the variable exists already). When it is false, it does not.
debugFlag = true;
if debugFlag & exist('varname','var')==1
varname = varname+1;
end

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by