secluded
secluded

Reputation: 517

hiding comments in matlab's editor

Is there a simple way to hide the comments while you're writing your code in matlab's editor? I have too many comments and they really get on my nerves sometimes. I did a little search and was surprised to find nothing on this simple issue! Thank you in advance

Upvotes: 3

Views: 2934

Answers (2)

dasdingonesin
dasdingonesin

Reputation: 1358

thewaywewalk's answer is probably what you were looking for, but for the sake of completeness: Even without block comments you can always fold the first comment in a function definition.

Before: Unfolded After:

Folded

Upvotes: 3

Robert Seifert
Robert Seifert

Reputation: 25232

One solution would be to use block comments

%{ 
Hello World
%}

and code folding (Preferences > Editor > Code folding)

enter image description here

And with right-click on the editor window you can "Fold all" then. If you don't want to get your functions and loops folded as well, uncheck that in the preferences.


I'm afraid there is no way in the Matlab Editor to hide all commented lines in general. You will need alternative editors like Notepad++ to do that.

Upvotes: 7

Related Questions