Clear Filters
Clear Filters

I want to change cart to polar !

1 view (last 30 days)
Kwon
Kwon on 26 Nov 2012
I want to change cart coordinate to polar system
for example
I read a image file and this value change to double value.
then this array is 3d value
and this chage to polar system
and I want to plot(r,theta) this polar system value ( not polar(r,theta)!!)
I want to see the plot that is plotting linear!!
help about this!
if true
% clear all;
clc
a=imread('slice.png');
b=double(a);
imagesc(b);
center=b(512,512);
Z=zeros(2000,3);
for r=1:1:512;
for t=1:1:512;
x=512+r;
y=512+t;
theta=((tan(t/r))^(-1)*180/pi);
radi=sqrt(r^2+t^2);
bvalue=b(x,y);
end
Z=[Z;radi,theta,bvalue];
end
plot(Z);code
end

Answers (1)

John Petersen
John Petersen on 29 Nov 2012
theta = atan2(t,r)*180/pi;

Categories

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