Code Sections disappeared. Cannot use %%
36 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Darcy
el 9 de Mzo. de 2015
Comentada: Jordi
el 11 de Jul. de 2025
I closed MATLAB and when I re-opened it, all my code sections were gone. I had previously enabled code folding around code sections as well and I can no longer do this.
For example, I have a code which has:
A=10;
B=20;
C=A+B;
D=A*B;
Previously, I could fold up the first section and run it separately from the second section. Now these code sections have disappeared. Any help or info is greatly appreciated.
I also cannot fold up my for, if, while statements etc. I have checked in Preferences and Code Folding is enabled.
1 comentario
Tobe freeman
el 12 de Jun. de 2015
Me, too! It's been flakey for ages. I am a little disappointed that there is nothing about this bug on Matlab central - or stackoverflow etc.
Respuesta aceptada
Christopher Buchanan
el 15 de Feb. de 2017
It sounds like MATLAB hasn't been able to parse the entire .m file - I had a similar issue until I realised one of my if/for statements hadn't been terminated with an 'end'...maybe until MATLAB is able to parse everything completely it doesn't know how to interpret context-sensitive markers like code folders and section breaks.
5 comentarios
Jordi
el 11 de Jul. de 2025
Note that having text after line continuations (...) may also result in MATLAB not being able to parse the entire .m file.
See e.g. https://nl.mathworks.com/matlabcentral/answers/2161765-code-folding-is-broken-can-t-see-hundreds-of-lines-of-code-in-editor#comment_3337221
Más respuestas (0)
Ver también
Categorías
Más información sobre Loops and Conditional Statements 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!