Make a polar plot from data
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Thorsten
2013-2-12
theta = pi*rand(1, 100);
th = linspace(pi/10, pi, 10);
hi = hist(theta, th);
polar(th, hi/numel(theta))
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polar Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!