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

New to MATLAB?

mark several line of code as comment

Asked by Locks

Locks (view profile)

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

Locks

Locks (view profile)

Products

No products are associated with this question.

2 Answers

Answer by Xu Zhang

Xu Zhang (view profile)

on 15 Apr 2013
Accepted answer

CTRL+R is the shortcut

1 Comment

Locks

Locks (view profile)

on 15 Apr 2013

perfect, thanks!

Xu Zhang

Xu Zhang (view profile)

Answer by Anand

Anand (view profile)

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

Sean de Wolski

Sean de Wolski (view profile)

on 15 Apr 2013

ctrl + t

Sean de Wolski

Sean de Wolski (view profile)

on 15 Apr 2013

Also, right clicking gives you these shortcuts

Locks

Locks (view profile)

on 15 Apr 2013

perfect, thanks

Anand

Anand (view profile)

Contact us