scale polar plot
4 views (last 30 days)
Show older comments
Hello,
I have a set of Gain values (in dB) stored in row vector G(1x360). When I plot G using the function
polar((1:360)*pi/180,G)
I get the directivity plot but it does not touch the boundary of the circle which makes it difficult to locate the exact angle (that is, the main lobe ends mid way inside the circle without touching its circumference). How can I change the radius/scale of the circle to make it fit perfectly?
[please note every time I run my program, my 'G' changes(since I have additive noise in my signal). So, I want to scale it according to the current G value each time.]
Please help
Please help
0 Comments
Answers (2)
Honglei Chen
on 11 Jan 2012
You can plot the normalized G if all you care is the location.
polar((1:360)*pi/180,G/max(G))
You should be careful using polar to plot directivity in dB because it is possible that G is negative. I think this could cause some issue with polar and you may need to offset the values.
6 Comments
Walter Roberson
on 12 Jan 2012
Glog = 10*log10(G);
polar((1:360)*pi/180, Glog/max(abs(Glog)))
You had values small enough that -log10 of them was greater than log10 of the maximum value. Apply the rescaling to what you are actually plotting, not to a pre-step.
Walter Roberson
on 11 Jan 2012
If the only purpose of the plot is to figure out where the maximum is, then that can be calculated without doing the plot -- it is the angle at which max(abs(rho)) is located.
If you want the concentric circles labeled by rho, then there is no way to do it short of hacking the polar() code [or equivalent]. The code figures out the maximum absolute rho, draws a square twice that size, then asks the plot subsystem how big the automatically calculated bounds were, and uses those automatic bounds to construct the circles. (The automatic bounds are such that "nice" circle sizes are easily calculated.) Everything is done in Cartesian coordinates for the drawing and labeling.
0 Comments
See Also
Categories
Find more on Polar Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!