Horizontal line in plot up to a graph
3 次查看(过去 30 天)
显示 更早的评论
How can I generate a horizontal line starting at x = 0 up to a graph (see figure, red line)? The x, y coordinates are of course available for the graph.
0 个评论
回答(1 个)
KSSV
2021-2-26
If you have the xlimits (x0,x1) and the y-value..the required equations is y = k.
x = 1:10 ;
k = 3 ;
y = k*ones(*Size(x)) ;
plot(x,y)
Also have a look on line.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!