Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

arrows in streamline

693 views
Skip to first unread message

Pieter Jacqmaer

unread,
Aug 22, 2009, 5:08:01 PM8/22/09
to
Hello,

anyone who knows how to draw streamlines in Matlab with specified starting points and arrows on each of them? Streamslice can draw arrows, but I'm not sure wether the starting points can be specified.

Thanks!

Pieter

Raphael Attie

unread,
Sep 16, 2009, 11:42:00 AM9/16/09
to
Gee ! I have exactly the same question. Any luck since your post ?
Indeed, streamslice does that only in a 2D-plane, if I understood it correctly. I personally need that for representation of magnetic field lines.

Fabian

unread,
Nov 20, 2009, 7:55:07 PM11/20/09
to
"Pieter Jacqmaer" <pieter....@gmail.com> wrote in message <h6pmnh$qu7$1...@fred.mathworks.com>...

you can use streamline(...) to draw the streamlines, then use get(...) to get the XData and YData of each streamline (do this in a loop) and put the information in a X and Y matrix. Then use quiver(X,Y,ux,uy,scaling) to put the arrows on the streamlines. You might want to define a vector nx = 1:floor(size(X,2)/n):size(X,2); where the integer n defines how many points you want to use to plot the arrows. If you dont do this, you get many arrows and the plot gets unreadable. If you do so, use quiver(X(ny,nx),Y(ny,nx,ux(ny,nx),uy(ny,nx),scaling)

Fab

0 new messages