Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
Connor Sherod
Connor Sherod am 12 Jul. 2018
Kommentiert: Connor Sherod am 13 Jul. 2018
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 Kommentare
dpb
dpb am 13 Jul. 2018
" 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 am 13 Jul. 2018
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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Polar Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by