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

Drawing arrows in Matlab

288 views
Skip to first unread message

schedar

unread,
Sep 30, 2001, 7:35:44 PM9/30/01
to
Hello,

I wonder if there is a smart way to draw an ARROW from one point to another
in Matlab (a command like LINE, or something similar) to represent a vector.

Thank you in advance


Bob Walton

unread,
Sep 30, 2001, 10:48:41 PM9/30/01
to
schedar wrote:
...

> I wonder if there is a smart way to draw an ARROW from one point to another
> in Matlab (a command like LINE, or something similar) to represent a vector.
...
Well, I don't know how smart it is, but you can add an arrow to a figure
by clicking on the "Add arrow" button on the figure's toolbar, and
drawing in the arrow you want using your mouse.
--
Bob Walton

H. Paul Jacobson

unread,
Oct 1, 2001, 12:01:34 AM10/1/01
to
On Sun, 30 Sep 2001, schedar wrote:

> I wonder if there is a smart way to draw an ARROW from one point to another
> in Matlab (a command like LINE, or something similar) to represent a vector.

Since v 4 there has been an ARROW() command in the user contributed
library. At its minimum you specify the start and stop points (as opposed
to vectors of x and y coordinates), but you can also specify the arrow
head shape and other properties. I believe the more recent figure edit
package includes an arrow command, but I have not used it.

Paul


Perttu Ranta-aho

unread,
Oct 1, 2001, 1:50:50 AM10/1/01
to

Bob Walton <bwa...@rochester.rr.com> writes:

And with some research you may find that the appropriate function is
ARROWLINE. Which however is undocumented :(. The syntax seems to be
something like:
arrowline([x_start,x_end],[y_start,y_end])

Such in case you want to draw arrow from script/function...

P.S. It isn't hard to make your own function that draw's an
arrow. There might be some good reasons why ARROWLINE is undocumented,
I've never used it, so I don't know.

--
Perttu Ranta-aho | Perttu.R...@uku.fi
Department of Applied Physics | http://venda.uku.fi
University of Kuopio, Finland | http://www.uku.fi

Glen DeLoid

unread,
Oct 1, 2001, 2:41:25 PM10/1/01
to
Hello,

There is currently no documented way to add an arrow from the command line.
This will be added to the next release. The undocumented arrow object is
ARROWLINE, but there is no good way that I am aware of to create one from
the command line. 'arrowline([x_start,x_end],[y_start,y_end])', will not
work.

Sorry,

Glen DeLoid
The Mathworks

"schedar" <sch...@wanadoo.es> wrote in message
news:9p83q5$5ei$1...@news.wanadoo.es...

Cedric

unread,
May 7, 2014, 11:01:10 AM5/7/14
to
"schedar" <sch...@wanadoo.es> wrote in message <9p83q5$5ei$1...@news.wanadoo.es>...
> Hey there actually is... if you use the function text(0,0,'\rightarrow') for example
so it would be something like:

text(0,0,'\uparrow','fontsize',2)

Finnian Webber

unread,
Dec 15, 2015, 1:36:52 PM12/15/15
to
"schedar" <sch...@wanadoo.es> wrote in message <9p83q5$5ei$1...@news.wanadoo.es>...
you can use quiver to do this i believe, in the format,

quiver(xstart,ystart,(xfinal-xstart),(yfinal-ystart),0);

with the added bonus that all those can be vectors to plot many arrows, or use quiver3 to do the same in 3space

Timothy Russell

unread,
Dec 1, 2016, 4:44:17 AM12/1/16
to
"schedar" <sch...@wanadoo.es> wrote in message <9p83q5$5ei$1...@news.wanadoo.es>...
Yes. For example, I just used quiver3(x_initial,y_initial,z_initial,x_final,y_final,z_final).
0 new messages