How to select data points for interpolation
古いコメントを表示
I am trying to interpolate between two points on my sinosoidal shaped graph. How do I select a desired range of points on that graph to interpolate from? I've tried using 'point(1): point(1)+5' but this is taking 5 numbers greater than point(1) and increasing by 1. ex: if the value of my point is 100.5 I get [100.5,101.5,102.5,103.5,104.5,105.5]. Instead I want to get the 5 data points which procede point(1).
回答 (1 件)
Rik
2020 年 12 月 5 日
Index your variable:
point(1:5)
5 件のコメント
Fadi Lama
2020 年 12 月 5 日
Fadi Lama
2020 年 12 月 5 日
Rik
2020 年 12 月 5 日
Doesn't the peaks function also return the indices?
Fadi Lama
2020 年 12 月 5 日
Rik
2020 年 12 月 5 日
The findpeaks function has a second output. Did you read the documentation? That second output is what you need to use.
Try it. If you don't manage to find a solution, please post the code you used so I can edit that instead of writing it from scratch.
カテゴリ
ヘルプ センター および File Exchange で Descriptive Statistics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!