i need code in matlab
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
yahai
le 22 Nov 2022
Réponse apportée : Image Analyst
le 22 Nov 2022
(x-a)^2+(y-b)^2=r^2 ,,, the point (a,b) center of circle and (r) the radius ..
with point (-1,3.2) --- (-8,4)--- (-6.5,-9.3)
2 commentaires
John D'Errico
le 22 Nov 2022
Hint 1: Use a loop.
Hint 2: Learn to use vectors, and arrays, to store that list of center coordinates.
Hint 3: Since this is a pretty basic question, do the MATLAB Onramp tutorials. Learn MATLAB.
Réponse acceptée
Image Analyst
le 22 Nov 2022
You didn't say what you wanted to do. I'll assume you want to draw the circles on a graph. Here is the code:
x = [-1; -8; -6.5];
y = [3.2; 4; -9.3];
r = 5;
viscircles([x, y], r);
axis equal
grid on
Also see the FAQ:
Plus de réponses (1)
Image Analyst
le 22 Nov 2022
See attached function.
x = [-1; -8; -6.5];
y = [3.2; 4; -9.3];
plot(x, y, 'b.', 'MarkerSize', 50);
% Find the center and radius of a circle going through those points.
[xCenter, yCenter, radius] = circlefit(x, y)
% Display the circle
viscircles([xCenter, yCenter], radius, 'Color', 'r');
axis equal
hold on;
% Plot center with a crosshairs
plot(xCenter, yCenter, 'r+', 'LineWidth', 2, 'MarkerSize', 100);
0 commentaires
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!