Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Arrow in plots

Subject: Arrow in plots

From: Paul

Date: 1 Nov, 2007 01:03:35

Message: 1 of 4

Has anybody used 'arrow' successfully?

Try:

figure
plot(1:10)
arrow([4 0],[4 4])

this should draw an arrow from the x-axis to the straight
line. But all I get is an error:

??? Error using ==> and
NaN's cannot be converted to logicals.

Error in ==> arrow at 731
page = (~isnan(page))&(page);

Subject: Arrow in plots

From: TorH

Date: 1 Nov, 2007 09:02:48

Message: 2 of 4

Your code works fine for me (Matlab version 7.0 R14).

You may try:

annotation('arrow',[.39 .39],[.11 .39])
 
but then the xy-coordinates have to be specified in the
[0,1] space of the figure. To overcome this, check out
ds2nfu.m by Scott Hirsch on the file exchange.

TorH




"Paul " <par@ceri.memphis.edu> wrote in message
<fgb8l7$f1m$1@fred.mathworks.com>...
> Has anybody used 'arrow' successfully?
>
> Try:
>
> figure
> plot(1:10)
> arrow([4 0],[4 4])
>
> this should draw an arrow from the x-axis to the straight
> line. But all I get is an error:
>
> ??? Error using ==> and
> NaN's cannot be converted to logicals.
>
> Error in ==> arrow at 731
> page = (~isnan(page))&(page);

Subject: Arrow in plots

From: TorH

Date: 1 Nov, 2007 09:03:02

Message: 3 of 4

Your code works fine for me (Matlab version 7.0 R14).

You may try:

annotation('arrow',[.39 .39],[.11 .39])
 
but then the xy-coordinates have to be specified in the
[0,1] space of the figure. To overcome this, check out
ds2nfu.m by Scott Hirsch on the file exchange.

TorH




"Paul " <par@ceri.memphis.edu> wrote in message
<fgb8l7$f1m$1@fred.mathworks.com>...
> Has anybody used 'arrow' successfully?
>
> Try:
>
> figure
> plot(1:10)
> arrow([4 0],[4 4])
>
> this should draw an arrow from the x-axis to the straight
> line. But all I get is an error:
>
> ??? Error using ==> and
> NaN's cannot be converted to logicals.
>
> Error in ==> arrow at 731
> page = (~isnan(page))&(page);

Subject: Arrow in plots

From: Vincent Leroux

Date: 26 Feb, 2013 12:55:08

Message: 4 of 4

What is the diference betwen quiver function "build in" Matlab and your function?



"Godzilla" wrote in message <fgb8l7$f1m$1@fred.mathworks.com>...
> Has anybody used 'arrow' successfully?
>
> Try:
>
> figure
> plot(1:10)
> arrow([4 0],[4 4])
>
> this should draw an arrow from the x-axis to the straight
> line. But all I get is an error:
>
> ??? Error using ==> and
> NaN's cannot be converted to logicals.
>
> Error in ==> arrow at 731
> page = (~isnan(page))&(page);

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us