Got Questions? Get Answers.
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:
Drawing Line of Figure

Subject: Drawing Line of Figure

From: Myles

Date: 22 Jun, 2012 20:43:07

Message: 1 of 2

I was curious if anyone had a link to a FEX to what I'm pretty sure is a common query.
I have a figure which I would like to draw a line on - I pick two points using ginput, and using those those two points I create a line through them which stretches across the entire figure.
This portion works perfectly, but what I need is some way to show a 'temporary' line after picking the first point. Right now I'm creating my line almost blindly based on a few landmarks, but it's difficult to remember where the first point has been placed and a 'guide' or 'temporary line' would be ideal to have after choosing the first point.

I appreciate the help, I haven't been able to find anything worthwhile through google searches and browsing through the FEX.

Subject: Drawing Line of Figure

From: Myles

Date: 25 Jun, 2012 16:28:07

Message: 2 of 2

"Myles" wrote in message <js2lcr$c8i$1@newscl01ah.mathworks.com>...
> I was curious if anyone had a link to a FEX to what I'm pretty sure is a common query.
> I have a figure which I would like to draw a line on - I pick two points using ginput, and using those those two points I create a line through them which stretches across the entire figure.
> This portion works perfectly, but what I need is some way to show a 'temporary' line after picking the first point. Right now I'm creating my line almost blindly based on a few landmarks, but it's difficult to remember where the first point has been placed and a 'guide' or 'temporary line' would be ideal to have after choosing the first point.
>
> I appreciate the help, I haven't been able to find anything worthwhile through google searches and browsing through the FEX.

Nevermind, MATLAB has a built in function which just needs to be edited slightly:

function draw_lines

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