polar plot to create circular shape with varying radius
18 ビュー (過去 30 日間)
古いコメントを表示
Hi Everyone,
I'm new to polar plotting and I'm struggling to sucesfully plot what I'm after.
I want to polar plot a random variable around an origin of my choice. I have tried to do this through the following code:
k = round(rand(1,50)*10)+10;
Th = linspace(0,2*pi,50);
Rho = k.*sin(Th);
figure
polar(Th,Rho)
However, this isn't quite working. As all the values are positive it's cramping the plot in the top 2 quadrants. Please see attached plot for what I mean. I have sketched the kind of plot I am after (apologies for how rough this sketch is) but any ideas would be realy appreciated.
Thanks everyone!
0 件のコメント
採用された回答
Star Strider
2019 年 7 月 19 日
Plotting the sine function in a polar plot will produce one circle in the upper half of the polar axes.
To get the sort of plot you want, do this:
figure
polar(Th,k)
2 件のコメント
その他の回答 (1 件)
infinity
2019 年 7 月 19 日
Hello,
How about if you change a bit like this
clear
close all
% k = round(rand(1,50)*10)+10;
k = round(rand(1,50));
Th = linspace(0,2*pi,50);
% Rho = k.*sin(Th);
Rho = k.*sin(Th)-10;
figure
polar(Th,Rho)
参考
カテゴリ
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!