What's the difference between surf and surface?

I think they are essentially the same function? But why do we have both of them? Are there any differences that I should keep in mind when making choices?

 Respuesta aceptada

Walter Roberson
Walter Roberson el 9 de Nov. de 2018
Editada: Walter Roberson el 2 de En. de 2019

7 votos

The difference is that surf checks first to see if the axes Nextplot property says to replace plot, and if so then it does a cla. Then either way it calls surface()
In other words if "hold on" is not in effect (or the internal equivalent) then surf will erase the current plot. surface() will not do that.
The difference is sort of like the difference between line() and plot(). line() never erases the current plot. plot() might erase the current plot, and whether it does or not it will call line to do the drawing work.

4 comentarios

Luna
Luna el 2 de En. de 2019
this was exactly what I am looking for. Thanks for nice answer!
Angelina Swift
Angelina Swift el 1 de Abr. de 2020
Thanks for the answer! It's really helpful!
siavash Aghaei
siavash Aghaei el 1 de Feb. de 2021
perfect and thorough answer; thanks!
斯淇
斯淇 el 29 de Ag. de 2023
Thank you! Really helpful!

Iniciar sesión para comentar.

Más respuestas (0)

Preguntada:

hzh
el 9 de Nov. de 2018

Comentada:

el 29 de Ag. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by