Taking 1d and 2d values from structure then interpolate

1 次查看(过去 30 天)
Hi, i have to create a code from 2 structure arrays and the code must first check if my data is 1 dimensional or 2 dimensional. From there it must check if the values of my variables are the same and store them in interpolated. For example, if i have 2 structures a and b and my data is 2d because i have 2 variables deBF and alpha. my code must first compare the values of alpha in a with those in b, if there is a common value i store it in matrix interpolated (interpolated = 40 in this case). secondly i compare deBF values in a with those in b, if there is no common value i must interpolate between 2 values and get the value (since deBF is 6 in a i must interpolate between 5 and 10 in b). Please help
b =
struct with fields:
deBF: [-11.7 -5 0 5 10 16.3 22.5]
alpha: [-10 -5 0 5 10 15 20 25 30 35 40 45 50]
CmBodyFlap: [7x13 double]
a =
struct with fields:
alpha: 40
Mach: 5
deBF: 6
deSB: 0
deA: 0

回答(1 个)

Gaurav Garg
Gaurav Garg 2020-6-9
Hey Willibes
You can run a loop and check if the values of deBF in a compare with those in b, and store them in the resultant array.
The same can be repeated for alpha as well.

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by