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?

 채택된 답변

Walter Roberson
Walter Roberson 2018년 11월 9일
편집: Walter Roberson 2019년 1월 2일

7 개 추천

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

Luna
Luna 2019년 1월 2일
this was exactly what I am looking for. Thanks for nice answer!
Thanks for the answer! It's really helpful!
perfect and thorough answer; thanks!
斯淇
斯淇 2023년 8월 29일
Thank you! Really helpful!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

질문:

hzh
2018년 11월 9일

댓글:

2023년 8월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by