How do I plot a circle with a given radius and center?
Ältere Kommentare anzeigen
I would like to plot a circle with a given radius and center.
Akzeptierte Antwort
Weitere Antworten (3)
serwan Bamerni
am 17 Feb. 2016
Bearbeitet: MathWorks Support Team
am 26 Mai 2023
9 Stimmen
There is now a function called viscircles():
2 Kommentare
Walter Roberson
am 17 Okt. 2016
This is part of the Image Processing Toolbox
Walter Roberson
am 25 Dez. 2020
viscircles(app.segmented, centres, radii, 'color', 'b')
Another possibility is to approximate the circle using a polyshape with a large number of sides and plot that polyshape.
p = nsidedpoly(1000, 'Center', [2 3], 'Radius', 5);
plot(p, 'FaceColor', 'r')
axis equal
1 Kommentar
Walter Roberson
am 9 Jun. 2021
Remember that an equilateral triangle has a 60 degree range.
Using function "fplot" would be my simplest way:
Unit circle:
fplot(@(t) sin(t), @(t) cos(t));
grid on
Circle with center "x", "y" and radius "r":
x = 3; y = 4; r = 5;
fplot(@(t) r*sin(t)+x, @(t) r*cos(t)+y);
grid on;
Kategorien
Mehr zu Polar Plots finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



