skipping code sections when running the code

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?

Respuestas (2)

Mike Danielsen
Mike Danielsen el 23 de Dic. de 2018

2 votos

Use this commenting function
%{
This wont run
%}
--------------------
%
This will run
%}
John D'Errico
John D'Errico el 13 de Jun. de 2018
Editada: John D'Errico el 13 de Jun. de 2018

0 votos

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.

Categorías

Más información sobre Get Started with MATLAB en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 12 de Jun. de 2018

Comentada:

el 30 de Ag. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by