2D PostProcessing plot in MATLAB

조회 수: 3 (최근 30일)
Pranay Suhas Chinthapandu
Pranay Suhas Chinthapandu 2018년 3월 19일
댓글: Pranay Suhas Chinthapandu 2018년 3월 22일
I want to plot my thermal analysis results on a 2D mesh. I have a 2xN matrix named "coord", which basically has the X and Y coordinates of the nodes of my mesh. At each node, I have a temperature value which is saved as a 1xN matrix. How do I plot a heatmap or a contour plot for my results? I've tried Surf fucntion, which expects a matrix of minimum size 2x2.. Where as my temperatures are saved as "nodeDisp" which is a 1xN vector leading to "Error using surf (line 71) Z must be a matrix, not a scalar or vector." I tried scatteredInterpolant, with which I could plot my mesh but no signs of the colored plot of displacements I wanted.

답변 (1개)

Venkata Siva Krishna Madala
Venkata Siva Krishna Madala 2018년 3월 22일
Hello Pranay,
Its better if you convert the coord to a Nx2 matrix and temperature values to a Nx1 matrix by transposing it. Then you can use the surf command as given below
surf(coord(:,1),coord(:,2),temperature_values)
This should remove the surf plot error and generate the plot as you need.
Regards,
Krishna Madala
  댓글 수: 1
Pranay Suhas Chinthapandu
Pranay Suhas Chinthapandu 2018년 3월 22일
Hello Krishna,
Temperature values are still a vector, irrespective of the fact that its a column or a row vector. I have the same error. I have tried scatteredInterpolant, fill3, mesh and everything, and the problem still pertains. I have attached a picture of what exactly I desire and following are the details of my data: 'coord' is a 2xN matrix where coord(1,:) is X coordinates and coord(2,:) is the Y coordinate at which the respective temperature value is nodeDisp(1,:). How do I build a correlation between these values and generate an interpolated graphical result as in the picture?

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

카테고리

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