Create different interpolation steps in a column

2 Ansichten (letzte 30 Tage)
Adi Purwandana
Adi Purwandana am 5 Jun. 2024
Kommentiert: Adi Purwandana am 5 Jun. 2024
Hello there,
I have a data consisted of two column, let's say the first column is depth and the next one is data_x (see excel file attached). The y (depth) has irregular spacing (see fig). My intention is how to make an interpolated profile with a regulation as follow (see fig):
  • the first upper 10 depth should be interpolated with 1-depth point resolution
  • the next one (12-30) depth should be interpolated with 2-depth points resolution
  • the next one (>30) depth should be interpolated with 50-depth points resolution
Anyone knows how to do that?

Akzeptierte Antwort

Matt J
Matt J am 5 Jun. 2024
newy=[1:10,12:2:30, 50:50:500];
newdata=interp1(y,data,newy);

Weitere Antworten (0)

Kategorien

Mehr zu Interpolation finden Sie in Help Center und File Exchange

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by