Borrar filtros
Borrar filtros

Function to output multiple figures

3 visualizaciones (últimos 30 días)
Yi-xiao Liu
Yi-xiao Liu el 10 de En. de 2020
Comentada: Meg Noah el 10 de En. de 2020
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 comentario
Meg Noah
Meg Noah el 10 de En. de 2020
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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by