MATLAB Puts One space between %'s (Comment)

3 Ansichten (letzte 30 Tage)
tinkyminky93
tinkyminky93 am 7 Apr. 2022
Bearbeitet: Fangjun Jiang am 7 Apr. 2022
Hello,
I am using shortcut of commenting which is CTRL+R but MATLAB puts one space between %'s. As you know, when we enter two %'s, it divides the code block. (%%) But I have to delete the spaces between them manually. What is the problem and how can I solve it? Thank you
Normal situation: (CTRL +R) + (CTRL +R) --> %%
My situation: (CTRL +R) + (CTRL +R) --> % %

Antworten (1)

Fangjun Jiang
Fangjun Jiang am 7 Apr. 2022
Bearbeitet: Fangjun Jiang am 7 Apr. 2022
I think that is the exact reason to add "%" and a space for "Ctrl+R", to avoid making "%%" by pressing "Ctrl+R" twice.
Adding "%%" is called Insert Section. You can add your own shortcut by MATLAB Preferences, Keyboard, Shortcuts.
Press "Ctrl+T" twice can remove the section.

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by