How to draw an arrow or triangle

Asked by Brett on 14 Nov 2012
Latest activity Commented on by Brett on 19 Nov 2012

Hello Matlab community, I am trying to draw an arrow. I am using Psychtoolbox and there doesn't seem to be a specific command for arrows or triangles. I know how to draw a line:

 line = [X-3,Y-40,X+3,Y+40];
 Screen('FillRect',window,[200,200,200], line');

So if someone knows the code to draw a triangle I can merge it with the code for a line to draw an arrow. Any help would be greatly appreciated.

Thanks, Brett

0 Comments

Brett

Products

No products are associated with this question.

1 Answer

Answer by Image Analyst on 14 Nov 2012

Are you aware of the annotation() function?

annotation('line',x,y)
annotation('arrow',x,y)
annotation('doublearrow',x,y)
annotation('textarrow',x,y)
annotation('textbox',[x y w h])
annotation('ellipse',[x y w h])
annotation('rectangle',[x y w h])
annotation(figure_handle,...)

2 Comments

Walter Roberson on 14 Nov 2012

This does not appear to be applicable to the drawing facilities supported by psychtoolbox.

Brett on 19 Nov 2012

Yes, as Walter said, this did not work.

Image Analyst

Contact us