Reputation: 517
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
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: After:
Upvotes: 3
Reputation: 25232
One solution would be to use block comments
%{
Hello World
%}
and code folding (Preferences > Editor > Code folding)
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