How to find intersection of 2 matrices

조회 수: 3 (최근 30일)
numan olmez
numan olmez 2019년 11월 2일
답변: Turlough Hughes 2019년 11월 2일
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
the cyclist
the cyclist 2019년 11월 2일
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 2019년 11월 2일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Turlough Hughes
Turlough Hughes 2019년 11월 2일
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.

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by