Azzera filtri
Azzera filtri

scattering a graph between specific points

1 visualizzazione (ultimi 30 giorni)
asd ad
asd ad il 17 Ago 2020
Commentato: asd ad il 17 Ago 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

Risposta accettata

KSSV
KSSV il 17 Ago 2020
Modificato: KSSV il 17 Ago 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')

Più risposte (0)

Categorie

Scopri di più su Discrete Data Plots in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by