Comment out the rest of the code

Suppose I have a list of codes and I would like to comment out everything after line 100. Is there any way simpler thatn %{.....%}?

2 Comments

Do you want automate the whole process? If so, you need to write a function that prepends '%' at the beginning of each non-empty after line 100 of your codes.
Not really sure it's any simpler (in truth, I'm not sure there's all that much that is simpler than %{ %}, but you can highlight the code and press ctrl R (all this does though is insert a % on every line)

Sign in to comment.

Answers (2)

* ctrl + G
* 100, enter
* ctrl + shift + end
* ctrl + R
whether or not it's simpler than %{ ... %} is up to you.

2 Comments

can it be done with breakpoints?
Huh? breakpoints have nothing to do with code comments so I don't even understand the question.

Sign in to comment.

David Fletcher
David Fletcher on 29 Mar 2018
I suppose you could put in a double %% at line 100 to create a new section, and then just use the run section option on the previous section of code. Saying that, with your comment about breakpoints I'm not entirely convinced we're even talking about the same thing

Categories

Products

Asked:

on 29 Mar 2018

Answered:

on 29 Mar 2018

Community Treasure Hunt

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

Start Hunting!