MATLAB Answers

Locks
0

mark several line of code as comment

Asked by Locks
on 15 Apr 2013

hi,

I know that the % sign is used to make code to comment, but unfortunately I am not able to do this for a whole paragraph, is there a way to mark a whole paragraph as comment?

  0 Comments

Products

No products are associated with this question.

2 Answers

Answer by Xu Zhang
on 15 Apr 2013
 Accepted answer

CTRL+R is the shortcut

  1 Comment

Locks
on 15 Apr 2013

perfect, thanks!


Answer by Anand
on 15 Apr 2013

If you want a comment block you could do this:

%{
...
CODE THAT SHOULDN'T RUN
...
...
%}

Note that the '%{' needs to be a new line with nothing else on that line.

  4 Comments

ctrl + t

Also, right clicking gives you these shortcuts

Locks
on 15 Apr 2013

perfect, thanks


Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!