Function to output multiple figures

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 Commento

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.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Creating, Deleting, and Querying Graphics Objects in Centro assistenza e File Exchange

Prodotti

Release

R2018a

Richiesto:

il 10 Gen 2020

Commentato:

il 10 Gen 2020

Community Treasure Hunt

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

Start Hunting!

Translated by