Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
Connor Sherod
Connor Sherod le 12 Juil 2018
Commenté : Connor Sherod le 13 Juil 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 commentaires
dpb
dpb le 13 Juil 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 le 13 Juil 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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Polar Plots dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by