Hello there,
I'm quite new to Matlab and stuck at a problem for a while and thus this is my first question.
What I have: A (x/y) dataset which is depicted by the blue line in the figure below
What I want:
  • Two extrapolating lines (depicted by dotted lines) through the maximum slope of the peak and the "ground" line respectively
  • Intersection Point of these lines to retrieve its x-coordinate
What I have tried: I tried using the following line for a first try, just to see what happens, however I am unable to plot the extrapolated line (Error Msg. Vectors must be the same length)
y1=interp1(t,hf,[2500:2600],'linear','extrap')
plot(t,y1)
As said I have not that much experience yet so I would highly appreciate any helpful input for solving this particular problem.
Best regards
soda.png

 採用された回答

KSSV
KSSV 2019 年 5 月 2 日

0 投票

You should be having coordinates of the lines: use this:

2 件のコメント

Jakob Mayr
Jakob Mayr 2019 年 5 月 2 日
編集済み: Jakob Mayr 2019 年 5 月 3 日
Thank you for your reply!
I used the interp1 method to retrieve some coordinates (I hope they are correct) and used your code snippet.
However I am afraid I am using it not correctly as it seems that that the lines were not yet defined: Error Msg. Input lines have to be specified with 2 points
EDIT: Ok I have now applied the function, however it seems that the point I'm getting does not represent the intersection of my defined lines.
I have double checked that the points specified in the function are indeed those obtained by the interp1 method.
What could be wrong here?
EDIT: Good news everybody, question is solved - it works.
darova
darova 2019 年 5 月 3 日
thanks god

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で MATLAB についてさらに検索

質問済み:

2019 年 5 月 2 日

コメント済み:

2019 年 5 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by