Technical query on surf command

조회 수: 1 (최근 30일)
Sukrit Ghorai
Sukrit Ghorai 2020년 8월 18일
댓글: Steven Lord 2020년 8월 18일
Hi
I have a technical question regarding surf command.
I wanted to know if I create a mesh grid having x & y values and create a function for getting z values for each of the points.
Then I have z values for each (x,y) . However when I plot, I see a single grid (square/rectangle) in the mesh represents one color but we have 4 values of z corresponding to one grid.
How does matlab know which value to use for getting the exact color value or does it do an average of z values and gets the corresponding color value.
Thanks
Sukrit

답변 (1개)

Walter Roberson
Walter Roberson 2020년 8월 18일
MATLAB chooses the color according to bilinear interpolation at the center of the face, using the information from the four corners of the face.
If you would prefer that interpolation not be done, that each input location corresponds to a color, then you should use texturemapping . The easiest way to do this kind of texture mapping is to use warp() instead of surf()
  댓글 수: 2
Sukrit Ghorai
Sukrit Ghorai 2020년 8월 18일
Thankyou sir
Steven Lord
Steven Lord 2020년 8월 18일
The description of the FaceColor, CData, and CDataMapping properties of a surface may be of interest.

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

카테고리

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