Visualize CFD data in a 2D mesh
Show older comments
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 Comments
Walter Roberson
on 21 Oct 2023
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
on 21 Oct 2023
Edited: António Rebelo
on 21 Oct 2023
Walter Roberson
on 21 Oct 2023
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
Accepted Answer
More Answers (0)
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


