Azzera filtri
Azzera filtri

What is the difference between those two functions?

47 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

Walter Roberson
Walter Roberson il 29 Gen 2017
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.

Più risposte (1)

Gilles Desvilles
Gilles Desvilles il 20 Gen 2022
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 !

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by