Visualize CFD data in a 2D mesh
이전 댓글 표시
I have a N-by-M 2D mesh with already assigned values of the quantity
for each one of the N*M cells (i = 1, 2, 3, ..., N*M).
for each one of the N*M cells (i = 1, 2, 3, ..., N*M).I have the nodes coordinates but I can't find a way to "plot" each
quantity as a color in the respective i cell.
quantity as a color in the respective i cell.I have tried to use 'pcolor' and 'surf' but the vectors x and y that define the mesh coordinates are always 1 unit too big...
Do you know how I could solve this problem?
Thank you!
댓글 수: 3
Walter Roberson
2023년 10월 21일
You talk about N*M cells. Is the implication that you have (N+1) y coordinates and (M+1) x coordinates? Or that you have an (N+1) by (M+1) array of x coordinates and another the same size of y coordinates?
You have coordinates of corners, including the corners at the end of the cell, but your mesh calculation is calculating on faces ?
António Rebelo
2023년 10월 21일
편집: António Rebelo
2023년 10월 21일
Walter Roberson
2023년 10월 21일
image and imagesc() ignores the coordinate vectors, except for the first and last coordinate in the vector. You cannot use imagesc() for the case where the nodes are not equally spaced.
Also note that the coordinates you pass to image() or imagesc() are treated as the coordinates of the center of the pixel. If you want to use the coordinates as the coordinates of the edge then you need to make an adjustment to the coordinates
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



