MATLAB: How to add arrow to a line (like quiver)

plot

Hello,
Consider I have a smple line. I want to add arrow (for example 4 arrows to this line) and show it in plot. Is it possible?
x = [0,1,2,3];
y=[ 4,4,4,4]
plot(x,y)
Thnaks

Best Answer

You may add marker ‘>’ to your plot. The below command plots the line with markers.
plot(x,y,'->')
If you specify only a marker symbol without a line style (as shown below), then plot displays only the markers with no line connecting them
plot(x,y,'>')
You may refer the following documentation to add markers