How can make arrows into the line step by step?
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Show older comments
0 votes
Share a link to this question
Accepted Answer
0 votes
What you see on the figure is a quiver3 plot, where the arrows describe velocity. You did not provide any velocity data, but you can make an arrow between every point in your plot as follows:
u = diff(x);
v = diff(y);
w = diff(z);
quiver3(x(1:end-1),y(1:end-1),z(1:end-1),u,v,w)
It is probably best to reduce the amount of data points, because you do not want 1500 arrows in your plot.
14 Comments
Myo Gyi
on 21 Oct 2018
That is didn't show arrow sir...
Yes it does, if you zoom in you can see. You need to reduce the number of pts on your graph so that the arrows become larger
No need to accept the answer if it doesn't work for you. It is less likely someone else will post a solution if they think you are satisfies with an answer.
Myo Gyi
on 22 Oct 2018
Yes Sir... Please give any suggestions sir.
see attached m-file. Note that the arrow size scales with the distance between the points. I don't know if you want them just for showing a direction or scale their size with something else, but you can adapt the code as needed.

Myo Gyi
on 22 Oct 2018
Thank you very much sir... If I want to change the direction of arrow, how can I do that sir?
jonas
on 22 Oct 2018
My pleasure!
The arrow direction and size is determined by w, v and u. Just set them all to negative and you get the opposite direction.
Myo Gyi
on 22 Oct 2018
Yes Sir...Thanks
Myo Gyi
on 26 Oct 2018
Hi jonas.. How can I make arrow to sart (0,0) point.
jonas
on 26 Oct 2018
quiver3(0,0,0,u,v,w)
u,v,w determine direction of your arrow.
Myo Gyi
on 26 Oct 2018
Thank you sir. But it is not show the arrow sir.
jonas
on 26 Oct 2018
see attachment
Thank you sir... When I use this code, the x axis is 0 to 20 or 0 to 15 sir.I need the x axis is 0 to 10 sir. How can I do that? And then if I take the value of a = 0.02, the quiver3 is not working sir.. Help me please sir..
jonas
on 26 Oct 2018
I don't understand. Quiver3 is really simple to use. The syntax is
quiver3(XStart, YStart, ZStart, XLength, YLength, ZLength,ScaleFactor)
then you can add various properties.
My code was just an example. Don't be afraid to actually change the values. If you want to change the range of the xaxis, then the syntax is.
set(gca,'xlim',[0 10])
What is a = 0.02?
Myo Gyi
on 26 Oct 2018
par.a = 0.02 sir
More Answers (0)
Categories
Find more on Vector Fields in Help Center and File Exchange
Tags
See Also
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)