How can I make a cartesian graph into a polar graph?

1 次查看(过去 30 天)
I have a 16x9 array, of which the last 8 columns are 1x37 matrices (for angles 0:5:180), so the end goal is to get 16 different graphs.
The last 6 columns were calculated by me, in radians. The columns 2 and 3 were read from a file, in degrees, so I convert those to radians and then try to plot them together, against the x value shown.
figure(1)
hold on
for i=0:5:180
x((i/5)+1)=(i*pi)/180;
end
for i=1:length(DataAll)
for j=2:3
DataAll{i,j}=DataAll{i,j}*pi/180;
end
end
for i=2:9
polarplot(x,DataAll{1,i});
end
Hopefully this is enough information to go on, if not I can provide more.
  6 个评论
dpb
dpb 2018-7-13
" theta to be the x from above, and the r values are the values within the 1x37"
So the idea is 16 figures with 8 lines on each?
How about attaching a .mat file with the data array for folks to play at...the polarplot is a pretty new beastie...
Connor Sherod
Connor Sherod 2018-7-13
Finally figured it out, it had nothing to do with the array itself. Instead it was the 'hold on' at the beginning, even though there was no previous graphs or axis for it to hold, so it was creating a figure with Cartesian axis on it.

请先登录,再进行评论。

回答(0 个)

类别

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

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by