How to print multiple graphs/figures in a for loop

10 ビュー (過去 30 日間)
MaryJo Whelan
MaryJo Whelan 2020 年 3 月 1 日
コメント済み: Walter Roberson 2025 年 2 月 3 日 20:35
Using this code all the figures flash very fast and then result in the last figure staying. How do I run this code and get all the graphs to print seperately?
  1 件のコメント
Walter Roberson
Walter Roberson 2025 年 2 月 3 日 20:35
It is better to post the text of code instead of an image of the text. There do not appear to be any MATLAB versions that are able to execute images of text.

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

回答 (1 件)

ag
ag 2025 年 2 月 3 日 18:02
The issue you are experiencing arises because the same figure handle is being used repeatedly to display the plots. To resolve this, you can create a new figure handle for each plot. The code snippet below illustrates this approach:
% Modify the line with figure(s) as shown below to create different figure handles
% for each column
figure(col)
For more details, please refer to the following MathWorks documentation: https://www.mathworks.com/help/matlab/ref/figure.html
Hope this helps!

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by