Contour plot of polar coordinates

26 ビュー (過去 30 日間)
Yigit Ozbas
Yigit Ozbas 2018 年 1 月 3 日
回答済み: erhamah alsuwaidi 2019 年 1 月 29 日
i have a 189*189 matrix which gives me a vector field in r and theta. I want a contour plot of that matrix. Any help would be greatly appreciated!

採用された回答

Birdman
Birdman 2018 年 1 月 3 日
Try the following. I transformed the polar coordinates to cartesian coordinates and then obtained a contour polar plot.
load('theta.mat');
load('r.mat');
% Convert to Cartesian
x = r.*cos(theta);
y = r.*sin(theta);
z = r-theta;
h = polar(x,y);
hold on;
contourf(x,y,z);
  2 件のコメント
Yigit Ozbas
Yigit Ozbas 2018 年 1 月 3 日
I tried something similar and found my mistake and now it finally works. Thanks for your help.
Birdman
Birdman 2018 年 1 月 3 日
You're welcome.

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

その他の回答 (1 件)

erhamah alsuwaidi
erhamah alsuwaidi 2019 年 1 月 29 日
why did you define z=r-theta?

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by