plotting the points near to origin

3 visualizaciones (últimos 30 días)
sampath kumar punna
sampath kumar punna el 29 de Oct. de 2019
Comentada: sampath kumar punna el 29 de Oct. de 2019
X Y
18 10
72 28
43 28
43 61
24 43
10 55
22 24
51 75
52 75
21 41
39 35
9 31
30 60
25 10
19 37
55 75
22 33
18 61
31 39
33 15
22 24
42 43
13 16
70 46
70 74
here is my x and y values, if i plot my graph i get it as shown below but i dont my graph with all points of my data
i wanted my graph like this as shown below, only the highlited part which is near to the zero, i want some points like 10-15 values which are near to the point zero from my data, and can i get values the points.
please can you help me to do this, which will be very help full for my execution
thanks

Respuesta aceptada

Rik
Rik el 29 de Oct. de 2019
Your data doesn't seem to fit your plots. The code below should give you an idea of how you could do this. You could also define a cutoff distance and show everything below that distance.
X=XY(:,1);Y=XY(:,2);%XY is the array as you posted in your question
dist_to_origin=sqrt(X.^2+Y.^2);
[~,order]=sort(dist_to_origin);
plot(X(order(1:10)),Y(order(1:10)),'o')
axis([0 80 0 80])
%instead of order(1:10) you can also use this:
L=dist_to_origin<=45;
plot(X(L),Y(L),'o')

Más respuestas (0)

Categorías

Más información sobre Get Started with Optimization Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by