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

4 ビュー (過去 30 日間)
Connor Sherod
Connor Sherod 2018 年 7 月 12 日
コメント済み: Connor Sherod 2018 年 7 月 13 日
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 Center および File ExchangePolar Plots についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by