Display the same image in two figures

1 回表示 (過去 30 日間)
sara khaled
sara khaled 2019 年 2 月 14 日
回答済み: Mark Sherstan 2019 年 2 月 15 日
I have a problem with gui the image displayed in the first Figure but the same image is not displayed in the figure after it
  1 件のコメント
jahanzaib ahmad
jahanzaib ahmad 2019 年 2 月 14 日
x=rand(10,2);
figure(1)
plot(x(:,1),x(:,2))
figure(2)
plot(x(:,1),x(:,2))
what the problem ?

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

回答 (1 件)

Mark Sherstan
Mark Sherstan 2019 年 2 月 15 日
You must have a figure or some variables saved which is affecting your output. Add the two lines at the start of your code to see if the problem persists. The following code gave me results shown below.
clear all
close all
x=rand(10,2);
figure(1)
plot(x(:,1),x(:,2)); title('Figure 1');
figure(2)
plot(x(:,1),x(:,2)); title('Figure 2');
Screen Shot 2019-02-14 at 8.28.13 PM.png

カテゴリ

Help Center および File ExchangeVisual Exploration についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by