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
0 个评论
采纳的回答
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 Center 和 File Exchange 中查找有关 Discrete Data Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!