필터 지우기
필터 지우기

What's the difference between surf and surface?

조회 수: 34 (최근 30일)
hzh
hzh 2018년 11월 9일
댓글: 斯淇 2023년 8월 29일
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일
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
siavash Aghaei
siavash Aghaei 2021년 2월 1일
perfect and thorough answer; thanks!
斯淇
斯淇 2023년 8월 29일
Thank you! Really helpful!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by