scattering a graph between specific points

1 次查看(过去 30 天)
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

采纳的回答

KSSV
KSSV 2020-8-17
编辑:KSSV 2020-8-17
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')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Discrete Data Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by