Skip to main content
1-Visitor
August 10, 2010
Solved

Simple 2D plot help

  • August 10, 2010
  • 2 replies
  • 8652 views

I am trying to create a simple 2D plot which shows the distance to pre-defined coordinates from origin. I can successfully plot the required data but have to manually input each vector element of Y & X for the lines indicating the distance from origin.

Can anyone suggest changing the method of plotting so this is done automatically?

The symbols in the graph update when additional elements are added to the input vectors, but the lines indicating the distance from the origin have to be manually inputted.

Cheers

Mike

Best answer by RichardJ

You need a matrix with one column for each line. Rather than creating two matrices for X and Y you can create one matrix with real and imaginary parts.

2 replies

RichardJ19-TanzaniteAnswer
19-Tanzanite
August 10, 2010

You need a matrix with one column for each line. Rather than creating two matrices for X and Y you can create one matrix with real and imaginary parts.

1-Visitor
August 10, 2010

Richard Jackson wrote:

You need a matrix with one column for each line. Rather than creating two matrices for X and Y you can create one matrix with real and imaginary parts.

Cheers Richard,

I know I said simple, but that was an almost instantaneous reply.

Mike

19-Tanzanite
August 10, 2010

I know I said simple, but that was an almost instantaneous reply.

I draw lines that way all the time. It's one of those tricks that's obvious, but only after you have been told how to do it 🙂

1-Visitor
August 11, 2010

Mike

Trying to understand your very original demand " all from origin & automatic"

Here is "all from origin" and automatic if you have those vectors from calculations.

If the vectors aren't from previously calculated, you will have to enter manually.

Jean

1-Visitor
August 11, 2010

Cheers Jean,

Another good example.

Mike