Interpolate non-unique values

18 Ansichten (letzte 30 Tage)
mldmnn
mldmnn am 18 Jun. 2018
Kommentiert: mldmnn am 6 Aug. 2018
I have two vectors for a symmetrical flyover to compute an aircraft noise footprint:
pressure = [0 0.5 1 2 4 2 1 0.5 0]
tUnequal = [4 4.3 5 6 6.3 7 7.13 9]
I want to interpolate that symmetric pressure vector for an evenly spaced time like:
tEqual = [4 5 6 7 8 9].
Interp1 does not work in this case due to the symmetry of the pressure vector:
Error using griddedInterpolant
The grid vectors must contain unique points.
Any suggestions?
  2 Kommentare
Matt J
Matt J am 18 Jun. 2018
In what way does it "not work"?
mldmnn
mldmnn am 18 Jun. 2018
Error using griddedInterpolant
The grid vectors must contain unique points.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Matt J
Matt J am 18 Jun. 2018
Bearbeitet: Matt J am 18 Jun. 2018
This might be what you want
>> pressureEqual=interp1(tUnequal, pressure(1:length(tUnequal)), tEqual)
pressureEqual =
0 1.0000 2.0000 2.0000 0.7674 0.5000

Weitere Antworten (0)

Kategorien

Mehr zu Interpolation finden Sie in Help Center und File Exchange

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by