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!