How to find intersection of 2 matrices

3 visualizaciones (últimos 30 días)
numan olmez
numan olmez el 2 de Nov. de 2019
Respondida: Turlough Hughes el 2 de Nov. de 2019
I have two matrices. One of them contains ground motion datas which does not have correlation between x and y so it is not a curve, and the other one is line with same slope. I need to find the intersection of those. In the figure orange is Ground motion called with X1=[x_1,y_1]-10000x2 matrix, and blue is X2=[x_2,y_2]- contain 5000x2 points to find the intersection. I used INTERX command which is provided in mathworks but it is not working properly and efficient, i am looking way to solve this problem. The figure can be seen below.
  2 comentarios
the cyclist
the cyclist el 2 de Nov. de 2019
Can you upload the data in a *.mat file?
Is X1 really 10000x10000? I would have expected 10000x2.
What do you mean by the "slope" of the ground motion data? A set of x-y points don't have a slope. Is it some kind of fit?
Do you derive the blue line from the ground motion data? Do you generate 5000 points along that line simply to get high resolution, hoping to find a close point to the ground motion data?
numan olmez
numan olmez el 2 de Nov. de 2019
Sorry for wrong words(and mistakes), it has constant slope not same and 10000x2. And again yes i have 5000 points, hoping to intersect with ground motion.

Iniciar sesión para comentar.

Respuestas (1)

Turlough Hughes
Turlough Hughes el 2 de Nov. de 2019
There is a handy function for exactly this:
[xi,yi]=polyxpoly(x_1,y_1,x_2,y_2);
It requires the mapping toolbox which doesnt take long to download.

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Productos


Versión

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by