interpolation between two fixed points
19 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I would please like to know how to find the upper and lower values for interpolation a certain value.
VehicleState =
Struct with fields:
alpha:40
deBF:6
deSB:0
deA:0
AerodynamicData.Cm.BodyFlap
ans=
struct with fields:
deBF: [-11.7000 -5 0 5 10 16.3000 22.5000]
alpha: [-10 -5 0 5 10 15 20 25 30 35 40 45 50]
How is the interpolation limits for deBF: 6 found in the above mentioned data?
2 Kommentare
John D'Errico
am 1 Jun. 2020
Your question i almost impossible to answer, without any information about what is being interpolated, and what the vectors of numbers indicate.
Antworten (1)
John D'Errico
am 2 Jun. 2020
I'd never have guessed what the quetion was from the initial question as written. But the answer is to use discretize.
You have some bin boundaries for deBF, and alpha.
deBFbins = [-11.7000 -5 0 5 10 16.3000 22.5000];
alphabins = [-10 -5 0 5 10 15 20 25 30 35 40 45 50];
In the case of alpha, it is easy to see where a number falls, since they are uniformly spaced. Simple arithmetic would suffice there.
deBF = 6;
ind = discretize(deBF,deBFbins)
ind =
4
deBFbins([ind,ind+1])
ans =
5 10
So it lives in bin #4, thus between 5 and 10.
You can use this for alpha also.
ind = discretize(40,alphabins)
ind =
11
0 Kommentare
Siehe auch
Kategorien
Mehr zu Interpolation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
