Convert from XYZ surface plot to just Z surface plot

조회 수: 4 (최근 30일)
Jonathan Wells
Jonathan Wells 2018년 10월 20일
댓글: Star Strider 2018년 10월 20일
I have a data set consisting of xcoord, ycoord, and density in vectors, exported from Fluent. I would like to be able to view the data as an m x n matrix, rather than as a surface plot, surf(X,Y,Z), so that I can access specific elements of that matrix directly. (i.e., I would like to be able to say density(ii,jj) = ....). I've tried many methods for doing this, and all have resulted in a skewed looking plot.
  댓글 수: 1
Walter Roberson
Walter Roberson 2018년 10월 20일
편집: Walter Roberson 2018년 10월 20일
view(2); for the viewing.
griddata for the array of values.

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

채택된 답변

Star Strider
Star Strider 2018년 10월 20일
You did not say what you have tried, and what did not work.
Consider:
Z = randn(100);
figure
surf(Z)
view(0,90)
That produces a (100x100) matrix, and the view call lets you look at it from the top, rather than from the side.
  댓글 수: 4
Jonathan Wells
Jonathan Wells 2018년 10월 20일
I must have overlooked that the first time, but griddata did the trick! Thank you both so much :)
Star Strider
Star Strider 2018년 10월 20일
Our pleasure!

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by