How to publish a script with the running time?

8 ビュー (過去 30 日間)
Cantor Set
Cantor Set 2020 年 2 月 29 日
回答済み: Aniket 2025 年 6 月 11 日 7:13
What is the best way to publish a code that takes nearly 30 mins with excution time?

回答 (1 件)

Aniket
Aniket 2025 年 6 月 11 日 7:13
There are several possible options to reduce the publishing time for your MATLAB script:
  1. Do not evaluate code on publishing: If you do not want the results to be published as well, you may skip evaluating code by setting "Evaluate Code" to false in Edit Publishing Settings --> Code Settings
  2. Change Figure settings: You may also update figure settings to create low resolution images or not creating thumbnails at all (if you are generating PDF)
  3. Use export command: Code execution sometimes take more time while publishing. therefore, you can convert your .m file to a live script file and use export command. This way, you can run the code beforehand and then use export command which does not re-run the code, hence saving time.
  4. Reduce overall code execution time: Optimise your code to reduce the code execution time. You may use tic/toc to pin-point the section that takes the most amount of execution time
I hope this helps!

カテゴリ

Help Center および File ExchangeMATLAB Report Generator についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by