Is it possible to make a circle containing specific points?

I want to make a circle using 'percentile'.
for example, If the percentile is 100, the circle contains every points.
I know how to make a quadrangle using perenctile. but i have no idea making a circle using percentile.
Thanks.

4 Comments

If percentage is less than 100 then which part should not be drawn?
In my last case for quadranle, I used 97.5 percentile.
so I did like this code to make a quardrangle containing points using 97.5 percentile.
prctile(trajectory(i).Longitude,[2.5 97.5]);
prctile(trajectory(i).Latitude,[2.5 97.5]);
But for circle, I have no good idea.
I'm just thinking that from a mean point, I draw a circle until the circle contain points using 97.5 percentile like the image.
Thanks
@Sierra: Let me ask you again to provide some input data, such that the readers do not have to guess, how the dots are stored. Many of your questions are hard or impossible to answer, because you do not provide enough details and several questions for clarifications did not get any response from you.
This is not an efficient way to use the forum. Please read and consider this: https://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer
Thanks, Jan
I read it and I will do that from now on.

Sign in to comment.

 Accepted Answer

You can use viscircles to draw a circle. Something like
numPoints = 200;
x = rand(1, numPoints) - 0.5;
y = rand(1, numPoints) - 0.5;
plot(x, y, 'b.', 'MarkerSize', 20);
grid on;
radii = sort(sqrt(x.^2 + y.^2), 'ascend');
% Find circle with 70% of the points
index = 70*length(radii)/100
index = 140
radius = radii(index)
radius = 0.4631
viscircles([0,0], radius, 'Color', 'r')
ans =
Group with properties: Children: [2×1 Line] Visible: on HitTest: on Show all properties
title('70% of points are within the red circle')
axis square

More Answers (0)

Asked:

on 2 Jun 2022

Commented:

on 4 Jun 2022

Community Treasure Hunt

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

Start Hunting!