code folding issue
9 views (last 30 days)
Show older comments
Hi there,
I've had some difficulties lately with code folding, specifically for cells. Using code folding for cells is useful as it allows me to breakup rather long scripts into various segments. In such cases, these segments contain various for and if and try loops.
A recent example script contains a sitaution where I had approximately 100 lines of code in one cell (with code folding working), and then a similar one right below it (also with code folding that was working). Then, below that, I would type:
%% please make new cell for me
And I would see no evidence of any code folding or any new cell creation.
There have been a few other situations of inconsistent activity I have seen with respect to code folding and cells (in particular with long scripts). Does anyone know what the soruce of this might be, and how I can write amy scripts in a way that would make this not happen?
Its worth noting that my script (from what I can see) has no major syntax errors (and there is an end statement wherever there is supposed to be one). Its also worth noting that at the beginning when I began to approach this issue, the first two cases of code folding weren't working either... I found that avoiding certain aspects of syntax seemed to help (such as avoiding one line for / end loops for example). I don't know why this helped.
It seems to be that code folding is a bit inconsistent and I might have to give up on it as a strategy for managing long scripts.
Thanks so much, Ben
5 Comments
Oleg Komarov
on 3 May 2011
I had cases like yours in the past but it's really hard to reproduce the same behaviour for others...then it's hard to detect and solve.
Answers (0)
See Also
Categories
Find more on Get Started with MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!