How to separate figures in a published pdf

3 ビュー (過去 30 日間)
Edward
Edward 2014 年 2 月 9 日
編集済み: Aniket 2025 年 6 月 11 日
Hi,
I've generated a load of code with multiple figures, and am looking to publish this code as a pdf with each figure displaying after the code that generated it. However, when I do publish, I see all the code (seperated by %) but all the figures appear together at the end.
How can I change this so the figures appear seperately?
Many thanks.

回答 (1 件)

Aniket
Aniket 2025 年 6 月 11 日
編集済み: Aniket 2025 年 6 月 11 日
The output is displayed at the end of code in a published file by default. However, each section output is displayed at end of section.
Therefore, you can divide the code into sections using "%%" after a call to plot/figure is made.
%%
vect = [1 2 3 4];
plot(vect);
%%
vect2 = [5 4 3 2];
plot(vect2);
This ensures output figure is shown just after its code.
Hope this helps!

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by