MATLAB Answers

skipping code sections when running the code

55 views (last 30 days)
alpedhuez
alpedhuez on 12 Jun 2018
Commented: Clifford Tatum on 30 Aug 2019
Suppose I have 30 code sections and test the 23rd one. It would be cumbersome that I need to run 22 sections each time. Suppose I want to skip 11th one that does not affect the other ones. Is there any simpler way to do this?

  0 Comments

Sign in to comment.

Answers (2)

Mike Danielsen
Mike Danielsen on 23 Dec 2018
Use this commenting function
%{
This wont run
%}
--------------------
%
This will run
%}

  0 Comments

Sign in to comment.


John D'Errico
John D'Errico on 13 Jun 2018
Edited: John D'Errico on 13 Jun 2018
If this is a script, then learn how to use cell mode.
Learn about live scripts.
If this is a function, then learn to write functions in a modular way.
If you can't handle either of the above, then copy the block of code out, put it into a separate file, then execute that.
Or just copy and paste the code into the command window as a block.

  1 Comment

Clifford Tatum
Clifford Tatum on 30 Aug 2019
'if you cant handle'...^...come on bro

Sign in to comment.

Sign in to answer this question.

Products