Matlab is not recognizing sections %%

조회 수: 107 (최근 30일)
Taylor Nichols
Taylor Nichols 2019년 1월 24일
댓글: Steven Lord 2024년 3월 31일 17:24
I am working with Matlab 2018a and for some reason Matlab stop recognizing my sections (%%). Maybe I did something after messing in Home>Preferences, but I'm not really sure. Has anyone had this problem before? I've look online and people say "Enable Cell Mode", but I have no idea how to do this in 2018a.
thanks in advance.
  댓글 수: 1
Reza Banaei
Reza Banaei 2022년 1월 6일
Look for open sentences in your code. Something like
'output' ...
will break the sectioning.

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

답변 (3개)

Steven Lord
Steven Lord 2019년 6월 18일
Look for the message indicator in your file in the Editor. See the first picture on this documentation page for the location of the message indicator. Is it red? If so your code has a syntax error that would prevent it from running successfully, and if your code is not syntactically valid I believe MATLAB will not recognize your sections. Correct the problems that Code Analyzer has identified as red (error) issues and I expect the sections should resune working.
  댓글 수: 4
ohad akler
ohad akler 2024년 3월 31일 17:10
Federico answer works !
Steven Lord
Steven Lord 2024년 3월 31일 17:24
Yes, MATLAB program file names are not allowed to contain spaces. Otherwise, consider the example Federico Sansalone posted. If you had both "Capacity Problem.m" and Capacity.m, would "Capacity Problem" call the first of those functions with no inputs or the second of those functions with the char vector 'Problem' as input?

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


Arvind Sathyanarayanan
Arvind Sathyanarayanan 2019년 1월 24일
Did you turn-off the sections in the Autoformatting menu? MA.png
  댓글 수: 2
Blake Porter
Blake Porter 2019년 6월 18일
I have the same issue and I have both section break options ticked. Restarted Matlab and computer did not help.
per isakson
per isakson 2022년 1월 7일
Is your "message indicator" green?

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


KIDKAWHI
KIDKAWHI 2021년 11월 17일
welp we all stuck in this boat
  댓글 수: 3
Marion Kreins
Marion Kreins 2021년 12월 23일
thx, it worked :)
per isakson
per isakson 2021년 12월 23일
편집: per isakson 2021년 12월 23일
Spaces in mfile names are not allowed. The "message indicator" of R2018b indicates the error. It's red!
However, in my simple case R2018b still recognizes the sections.

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by