How to plot a circle of some radius on a polar plot ?

 Réponse acceptée

th = linspace(0,2*pi,50);
r = 10;
polar(th,r+zeros(size(th)))

2 commentaires

L K
L K le 18 Mar 2017
thanx :)
Ron Beck
Ron Beck le 2 Mar 2018
Modifié(e) : Ron Beck le 2 Mar 2018
I have used this script and it works (changed polar to polarPlot) but can't run it as a function. Any ideas?

Connectez-vous pour commenter.

Plus de réponses (1)

Gabriel Malagon Carvajal
Gabriel Malagon Carvajal le 9 Sep 2017

0 votes

When is not center in the origen?

1 commentaire

%need centres for demo purposes
xc = randn() * 5; yc = randn() * 5;
%the work
th = linspace(0,2*pi,50);
r = 10;
[x,y] = pol2cart(th,r);
[th1, r1] = cart2pol( x+xc, y+yc );
polar(th1, r1);

Connectez-vous pour commenter.

Catégories

En savoir plus sur Polar Plots dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by