Section headers are formatting as comments: how to get SH working again?
44 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Samuel Veith
el 22 de Ag. de 2019
Editada: Samuel Veith
el 23 de Ag. de 2019
My section headers are formatting as comments. I was editing my code and was commenting out a block. I entered "%}" in first, and it didn't comment out when I wrote the %{ above it. Since then, my section headers are not functioning. The SH have default color settings and I can't run individual sections either. Does someone know what I messed up?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/235013/image.png)
0 comentarios
Respuesta aceptada
Steven Lord
el 22 de Ag. de 2019
You have an error in your code near the end of the file. You're missing the loop variable.
for 1:totalNumberOfFiles
Because of that error, your code is not a valid MATLAB script. Fix that error and the Editor will be able to enable section mode.
To detect this, I copied your code into MATLAB Editor and looked along the right margin of the Editor for the red line indicating Code Analyzer has detected an error.
1 comentario
Más respuestas (1)
AdamG2013468
el 22 de Ag. de 2019
From the home tab, under the ENVIRONMENT panel, select preferences. Expand the "Editor/Debugger" option from the list, then go to "autoformatting".
Under the "Section Break" section, are both of the boxes checked (they should be)?
3 comentarios
AdamG2013468
el 22 de Ag. de 2019
You may have to copy your actual code into this question for further troubleshooting. Use the code feature (alt+enter) to use MATLAB formatting.
Ver también
Categorías
Más información sobre File Operations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!