interpolation between two fixed points
4 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
John D'Errico
2020 年 6 月 1 日
Your question i almost impossible to answer, without any information about what is being interpolated, and what the vectors of numbers indicate.
回答 (1 件)
John D'Errico
2020 年 6 月 2 日
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 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
