HIDE COMMENTS IN PROGRAMS

20 ビュー (過去 30 日間)
Ciro
Ciro 2020 年 2 月 19 日
コメント済み: Image Analyst 2022 年 3 月 16 日
Hi all,
I would like to hide only the comments in my code. I've noted that, sometimes, a small horizontal dash appears along the side vertical line which starts from the minus sign generated when a '%%' is typed in the beginning of a section. It is very useful because if you push on the minus sign, all the raws (codes and comments) between the minus sign and the horizontal dash are hidden. Point is that I'm not able to decide where locate the horizontal dash... I did not understand the logic with which, from time to time, the text editor makes it (the horizontal dash) appear.
Is there a way to make the horizontal dash appear in the beginning of a desired raw?
To make me better understand, I've prepared a picture that include some screenshoot that shows what I mean. You find it attached to the present post.
Regards!
Ciriaco Pannese

回答 (3 件)

Steven Lord
Steven Lord 2020 年 2 月 19 日
That functionality is called code folding. Only certain types of constructs can be folded. Most of the constructs that can be folded are enabled by default, but you can check the Preferences for the complete list and enable folding for those constructs for which it isn't the default if you so choose.
The %% starts a new code section (for running and publishing code) which is foldable by default.

Muhammad  Asghar
Muhammad Asghar 2022 年 3 月 16 日
Close all
  1 件のコメント
Image Analyst
Image Analyst 2022 年 3 月 16 日
This does not make all the comments in your code invisible. What it does is to close any figure windows that you have open, with plots or images, etc.

サインインしてコメントする。


Muhammad  Asghar
Muhammad Asghar 2022 年 3 月 16 日
Close all comments in matlab

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by