Hello, I would like to run sections of my code that are delimited (by %%). The GUI apparently seems to section off my code using the %% notation, but it does not give me the option to run the sections - as seen in this picture:
I have seen other threads that have discussed the inability to run individual sections of code, but I have not had any success implementing anything that I've found. Any ideas on what I can do to troubleshoot this?

1 件のコメント

madhan ravi
madhan ravi 2018 年 8 月 28 日
upload your file.

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

 採用された回答

madhan ravi
madhan ravi 2018 年 8 月 28 日
編集済み: madhan ravi 2018 年 8 月 28 日

3 投票

The root of the problem was auxiliary functions defined within the main script. Since these functions were located in one of the sections, you can't call them from other sections separately. The solution was to save auxiliary functions as separate m-files.

4 件のコメント

Steven Sagona
Steven Sagona 2018 年 8 月 28 日
Thank you for your response. This is a very frustrating conclusion though, as the entire point of this script I've written is so that I can have a script that contains all of my functions - so I can easily keep track and edit everything together.
madhan ravi
madhan ravi 2018 年 8 月 28 日
yea I know but Matlab stores data after when the code is being run.
madhan ravi
madhan ravi 2018 年 8 月 28 日
編集済み: madhan ravi 2018 年 8 月 28 日
so the better thing would be to run the whole script first and then you can run each sections separately like live editors because each one is interconnected with one another.
madhan ravi
madhan ravi 2018 年 8 月 28 日
編集済み: madhan ravi 2018 年 8 月 28 日
if you find it useful please do accept the answer.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeEntering Commands についてさらに検索

タグ

質問済み:

2018 年 8 月 28 日

編集済み:

2018 年 8 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by