Filter löschen
Filter löschen

What's the difference between surf and surface?

34 Ansichten (letzte 30 Tage)
hzh
hzh am 9 Nov. 2018
Kommentiert: 斯淇 am 29 Aug. 2023
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?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 9 Nov. 2018
Bearbeitet: Walter Roberson am 2 Jan. 2019
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 Kommentare
siavash Aghaei
siavash Aghaei am 1 Feb. 2021
perfect and thorough answer; thanks!
斯淇
斯淇 am 29 Aug. 2023
Thank you! Really helpful!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by