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?

回答 (2 件)

Mike Danielsen
Mike Danielsen 2018 年 12 月 23 日

2 投票

Use this commenting function
%{
This wont run
%}
--------------------
%
This will run
%}
John D'Errico
John D'Errico 2018 年 6 月 13 日
編集済み: John D'Errico 2018 年 6 月 13 日

0 投票

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 件のコメント

Clifford Tatum
Clifford Tatum 2019 年 8 月 30 日
'if you cant handle'...^...come on bro

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeGet Started with MATLAB についてさらに検索

製品

タグ

質問済み:

2018 年 6 月 12 日

コメント済み:

2019 年 8 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by