Contour plot of polar coordinates

48 views (last 30 days)
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!

Accepted Answer

Birdman
Birdman on 3 Jan 2018
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 Comments
Yigit Ozbas
Yigit Ozbas on 3 Jan 2018
I tried something similar and found my mistake and now it finally works. Thanks for your help.

Sign in to comment.

More Answers (1)

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

Categories

Find more on Contour Plots 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!