Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does matlab have a function which can calculate the intersections of two line in N ($N\in R$)dimension?

line 1 is as follows $w_1^Tx_2=c_1$, where $w_1,x_1 \in R^N$ line 2 is as follows $w_2^Tx_2=c_2$, where $w_2,x_2 \in R^N$

Sorry, the above are hyperplanes. Since hyperplanes can be written in a concise way but lines in dimension ($N>2$) cannot, I tend to make a mistake like this.

Maybe the most concisest way to form a line is as follows, the line through $x_0$ in the direction $v$, $x=x_0+kv,k\in R$

I know there is a function 'polyxpoly'. But it only deal with $N=2$, right?

Thank you;)

share|cite|improve this question
Can't you write one yourself? – dfeuer Jul 28 '13 at 19:44
Also, how do these equations describe lines? Don't they actually describe (hyper)planes? – dfeuer Jul 28 '13 at 19:46
May I ask you why are you using MATLAB for doing this? – Mahdi Khosravi Jul 28 '13 at 19:56
Yes, you are right. Sorry about that! – Vivian Jul 28 '13 at 19:56
@MahdiKhosravi: there are all sorts of reasons someone might want to do something in MATLAB. Two obvious ones are: 1. They are familiar with it, so they prefer to work within it when possible 2. They need to do something within the context of a larger MATLAB program, and it's usually better to do so in MATLAB rather than having to muck about with a foreign function interface. – dfeuer Jul 28 '13 at 19:58

Try this. Do you have this in your version of matlab?

share|cite|improve this answer
No. This problem is equivalent to nothing more than solving a linear system. If done in symbolic math, the appropriate function would be sym/linsolve, which is a wrapper around the symbolic version of mldivide. – horchler Jul 28 '13 at 21:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.