Plot 2d pressure field
조회 수: 9 (최근 30일)
이전 댓글 표시
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
Sara
2014년 6월 9일
Try looking at the interp functions in matlab. Otherwise you can write your own bilinear interpolator
답변 (1개)
Image Analyst
2014년 6월 6일
Try scatteredInterpolant() to make a solid 2D array out of the individual scattered points, then display with imshow() or image().
댓글 수: 2
Image Analyst
2014년 6월 6일
imshow(yourImageArray, []); % Requires Image Processing Toolbox.
image(yourImageArray); % Does not require Image Processing Toolbox.
참고 항목
카테고리
Help Center 및 File Exchange에서 Discrete Data Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!