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 Center および File ExchangeMatrix Indexing についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by