0

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;)

Vivian
  • 583
  • 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
  • @dfeuer I meant he could do that himself and put the result on MATLAB functions, m-files, ... . – Mahdi Khosravi Jul 28 '13 at 20:02
  • Teaching people to use tools efficiently is better than giving them any tools they think they need! – Mahdi Khosravi Jul 28 '13 at 20:05
  • Would it be sufficient to solve this with matrices? All you would have to do is enter the coefficients in the right way, then apply the appropriate matrix function to have matlab spit out the answer – Ben Grossmann Jul 28 '13 at 20:09

1 Answers1

1

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

Ben Grossmann
  • 225,327
  • 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