Plot 2d pressure field
9 views (last 30 days)
Show older comments
I would like to plot a 2d pressure field, i.e., I have two vectors x, y and the pressure P on each point. I would like to plot a colored map for the pressure field.
I used the scatter function to do it (scatter(x,y,5,P)), but it plots only the points on the coordinates x,y, but the spacing is too large.
I tried to use other functions such as surf or mesh, but it won't work (size(P) must be [length(y),length(x)].
8 Comments
Sara
on 9 Jun 2014
Try looking at the interp functions in matlab. Otherwise you can write your own bilinear interpolator
Answers (1)
Image Analyst
on 6 Jun 2014
Try scatteredInterpolant() to make a solid 2D array out of the individual scattered points, then display with imshow() or image().
2 Comments
Image Analyst
on 6 Jun 2014
imshow(yourImageArray, []); % Requires Image Processing Toolbox.
image(yourImageArray); % Does not require Image Processing Toolbox.
See Also
Categories
Find more on Colormaps 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!