フィルターのクリア

Plot 2d pressure field

16 ビュー (過去 30 日間)
Thales
Thales 2014 年 6 月 6 日
コメント済み: Thales 2014 年 6 月 10 日
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
Sara 2014 年 6 月 9 日
Try looking at the interp functions in matlab. Otherwise you can write your own bilinear interpolator
Thales
Thales 2014 年 6 月 10 日
Ok, thank you.

サインインしてコメントする。

回答 (1 件)

Image Analyst
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 件のコメント
Thales
Thales 2014 年 6 月 6 日
How do I do that? Never used imshow or image to plot something...
Image Analyst
Image Analyst 2014 年 6 月 6 日
imshow(yourImageArray, []); % Requires Image Processing Toolbox.
image(yourImageArray); % Does not require Image Processing Toolbox.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeColormaps についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by