scattering a graph between specific points

1 visualización (últimos 30 días)
asd ad
asd ad el 17 de Ag. de 2020
Comentada: asd ad el 17 de Ag. de 2020
Hello everyone,
I'm looking to scatter two sets of data across a graph between specific points. I would like to scatter 9 points between x = 1.36 and x = 0.97 and I would like to scatter on the same graph 11 points of different size between x = 1.32 and x = 0.93. All the data points are at y = 0. How do I do this?
Thank you

Respuesta aceptada

KSSV
KSSV el 17 de Ag. de 2020
Editada: KSSV el 17 de Ag. de 2020
Two cases:
Case 1: If the points are equidistant
x1 = linspace(0.97,1.36,9) ;
x2 = linspace(0.93,1.32,11) ;
y1 = zeros(size(x1)) ;
y2 = zeros(size(x2)) ;
plot(x1,y1,'*r',x2,y2,'*b')
Case 2: If the points are random
x1 = linspace(0.97,1.36,100) ;
x2 = linspace(0.93,1.32,100) ;
x1 = x1(randperm(100,9)) ;
x2 = x2(randperm(100,11)) ;
y1 = zeros(size(x1)) ;
y2 = zeros(size(x2)) ;
plot(x1,y1,'*r',x2,y2,'*b')

Más respuestas (0)

Categorías

Más información sobre Discrete Data Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by