Is there a way to create a new figure within a function?

3 ビュー (過去 30 日間)
jake stan
jake stan 2018 年 4 月 7 日
コメント済み: Walter Roberson 2018 年 4 月 7 日
I'm trying to graph something, and whenever I send the inputs to my function I want it to produce an entirely new set of figures, not just replace the previous figures.
graph_plot(1,2) %calling my function
graph_plot(2,4) %calling my function again
%but then replaces my graphs of the previous,
%trying to make it so it's a different figure set
function graph_plot(x,y)
%random code
%the end of my function
figure;
plot(x,y); %At the end of my function
end
  1 件のコメント
Walter Roberson
Walter Roberson 2018 年 4 月 7 日
Sure, the figure call you already have should do that for you.
If it isn't working, check to see if you have any calls to close hanging around, such as a call to close all

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by