フィルターのクリア

Interpolate y-values from x-values, outside the limit of the x-values

1 回表示 (過去 30 日間)
Espen Mikkelsen
Espen Mikkelsen 2018 年 3 月 27 日
コメント済み: Torsten 2018 年 3 月 27 日
I have one array with height values and another with density.
Height = [0 386.5 446.1 526.6 621.5 660.6 711.4 734.9 792.8 810.2 817.9 893.7 1136.8 1317 1420.2 1426.2]
Density = [1.225 1.216 1.203 1.194 1.182 1.178 1.171 1.169 1.161 1.160 1.160 1.151 1.122 1.101 1.091 1.091]
I want to interpolate, so I can find the density of any heights. When I try to interpolate for density values higher than the largest height value which is 1426.2, I only get a NaN value.
F.eks when I try to interpolate at height 2000m like this:
Out = interp1(Height,Density,2000);
What can I do?

回答 (1 件)

Torsten
Torsten 2018 年 3 月 27 日
https://de.mathworks.com/help/matlab/ref/interp1.html#btw2a2x
Best wishes
Torsten.
  2 件のコメント
Espen Mikkelsen
Espen Mikkelsen 2018 年 3 月 27 日
編集済み: Espen Mikkelsen 2018 年 3 月 27 日

Thank you so much. I hope you could help me again. I found out that this code should work:

interp1(Height,Density,2000,'linear','extrap');

y-value(density) should decrease when x-value(height) is increasing. Instead y-value stays nearly flat and even slightly increasing when x-value is increasing. That doesnt make sense. The original curve is clearly decreasing linearly. I have no idea how I can solve this.

Torsten
Torsten 2018 年 3 月 27 日
I don't know MATLAB's extrapolation formula, but don't trust in extrapolation anyway.
If you know better, you should include your own correlation.
Best wishes
Torsten.

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

カテゴリ

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