Make a polar plot from data
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am trying to make a polar plot of a set of data in file called 't8m'. I am calculating parameters as:
- theta angle = arccos (column 4)
- bin width = 10 (making a total of 18 bins between 0 and 180deg).
- length of each bin should be = (number of the theta angles that fall in the bin)/total number of all angles between 0 and \pi. This can be seen as length of array within the bin/length of array in that frame.
I am having problems with the for loop and the polar plot command. Can someone help out with this loop? Here is what I have now:
izm=length(t8m)
theta = acosd(nz) ;
for i = drange(0:10:180)
k= 0.0
for j = 1:izm
if theta == i
k = k+1
lth1 = k/length(k)
end
end
end
polar(theta,lth1,'--r')
0 Kommentare
Akzeptierte Antwort
Thorsten
am 12 Feb. 2013
theta = pi*rand(1, 100);
th = linspace(pi/10, pi, 10);
hi = hist(theta, th);
polar(th, hi/numel(theta))
Siehe auch
Kategorien
Mehr zu Polar Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!