What is the difference between those two functions?

조회 수: 95 (최근 30일)
Denny Muttathil
Denny Muttathil 2017년 1월 29일
답변: Gilles Desvilles 2022년 1월 20일
I have been using the function mesh and surf on two different occasions, but i still don't understand, what exactly is the difference between those two.

채택된 답변

Walter Roberson
Walter Roberson 2017년 1월 29일
surf() and mesh() both create Chart Surface Objects in current releases. surf() turns on face coloring by default and uses black edges by default, whereas mesh() turns face coloring off by default and uses colored edges by default.
When you draw a large surface the edges usually get in the way of seeing anything (they are constant width but the individual tetrahedrons get smaller with larger surfaces), so I typically turn edges off.
Sometimes what you want is to see the outside of a solid surface; surf() gives you that. But the face colors hide the interior details (hidden line removal) and sometimes you need that internal detail so it is nice to have mesh() sometimes.
Just different defaults on the same graphics object. Not all that different in a way from (for example) plot() vs semilogx(), which differ only in whether the axes XScale is set to 'log' or 'normal', different defaults for the same graphics object.

추가 답변 (1개)

Gilles Desvilles
Gilles Desvilles 2022년 1월 20일
Not clear enough
when one is on the other is out and vice versa, nice rhetoric but doesn't work, except in cricket !
too much litteral not enough examples, please provide quickly replicable examples in your answer
when I use surf(x,y,z,'edgecolor', 'none') and mesh(x,y,z) I get the same result, so I don't see how the face coloring is different between the two functions as you claim it
Besides, I don't understant what you mean by the "outside" of a solid surface, neither the "interior" details: the logics linking the outside and the interior escapes me, again please provide examples that we can graph to understand what you mean
Maps are so important in many fields that you must clarify !

카테고리

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