Contour plot of polar coordinates

50 次查看(过去 30 天)
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.

请先登录,再进行评论。

更多回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 Contour Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by