Function to output multiple figures

1 次查看(过去 30 天)
I am trying to write a function that could output multiple figures
function [fig1,fig2] = FunctionName(Input1,Input2,Input3)
...
fig1=surf(...)
fig2=surf(...)
end
But the returned value of fig1 and fig2 do not seem to be a graph. Did I do anything wrong?
  1 个评论
Meg Noah
Meg Noah 2020-1-10
Solution:
function [fig1,fig2] = multiplot()
fig1 = figure();
surf(rand(15));
fig2 = figure();
surf(magic(15));
end
Explanation: second call to surf overwrote the data in the figure created by the first call to surf.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by