Linear Interpolation code ...

3 ビュー (過去 30 日間)
ddmm
ddmm 2021 年 1 月 19 日
編集済み: ddmm 2021 年 1 月 20 日
I have a data set (x) containing 1024 data and another corresponding data set (y).
What I want to do is find out which two numbers integers are in x, and use these two numbers and the corresponding y value in the formula below and find p value for every integer.
p = [(y2-y1) / (x2-x1)] * (i-x1) + y1
i = 178,179 ... 1931 (integers)
x1 <i <x2
y1 and y2; Corresponding values to x1 and x2.
x = 177.1458, 179.1622, 181.178 ...., 1930.821
y = 653, ..., 300
thank you in advance

採用された回答

Matt J
Matt J 2021 年 1 月 19 日
編集済み: Matt J 2021 年 1 月 19 日
p=interp1(x,y, ceil(x(1)):floor(x(end)) );
  1 件のコメント
ddmm
ddmm 2021 年 1 月 20 日
thanks

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by