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

Log in to comment.

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

perfect, thanks!

Log in to comment.


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

Show 1 older comment

Also, right clicking gives you these shortcuts

perfect, thanks

Log in to comment.


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!