Interpolating scattered data with 2 different sample rates

2 ビュー (過去 30 日間)
db94z28
db94z28 2019 年 2 月 5 日
回答済み: db94z28 2019 年 2 月 5 日
I'm trying to interpolate a scattered dataset that has 2 different sample rates. The data is a simple temperature and depth plot, but I am trying to create a synthetic geothermal plot that has the same sample rate as the measured data.
So far, I have generated my synthetic data what I've called "Depth 1" and "Temp1" sampled at about 100ft, and "Depth2", sampled every 1.6 feet. I need to find where "Temp2" would fall when interpolated at "Depth1".
I've tried scatteredInterpolant and interp1, but the vectors "Depth1" and "Depth2" have a very different number of values. As such:
>> Temp2 = scatteredInterpolant(Depth1,Temp1,Depth2)
Error using scatteredInterpolant
The number of data point locations should equal the number of data point values.
Is there a better way to go about this?
Hopefully i've explained it correctly, and I appreciate any help.

採用された回答

db94z28
db94z28 2019 年 2 月 5 日
I answered my own question. I had to remove NaNs from my imported varibles, then a simple interp1.
Temp2 = interp1(Depth1,Temp1,Depth2)

その他の回答 (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