plot two vectors simultaneuosly on the same axis?
6 次查看(过去 30 天)
显示 更早的评论
Regards. I have 2 vectors. For example a=[2 4 3 6 7 8] and b=[7 5 2 4 4 1]. I wolud like to plot them both on x axis simultaneously, for exampe in order a=2,b=7,a=4,b=5... y axis is supposed to be 0 for vector a and 1 for vector b. is this possible to do? Thank you.
0 个评论
采纳的回答
Azzi Abdelmalek
2014-3-28
a=[2 4 3 6 7 8]
b=[7 5 2 4 4 1]
x=[a ;b]
x=x(:)
y=[zeros(size(a)); ones(size(b))]
y=y(:)
plot(x,y)
4 个评论
Azzi Abdelmalek
2014-3-28
The order is not 2 1 2 1, you can check by
disp(x)
Maybe you mean something else
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Visual Exploration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!