How to create a direct lookup table with data from 3 vectors with different dimensions

3 次查看(过去 30 天)
Hi,
I am currently having isues creating a lookup table in MATLAB. Basically I have 4 cases
case 1: max battery weight with max fuel
case2: max battery weight with min fuel (empty)
case 3: min battery weight (zero) with max fuel
case 4: min battery weight (zero) with min fuel (empty)
with those cases, I have computed data (results) containing c.g., inertia and mass info (basically 3 vectors) corresponding to each one of the 4 cases. I need a 2D-lookup table where I give it an input case and I get the 3 vector outputs related to that input.
I am having issues with the indexing of making the 2D tables from the 3 vecors data...
I am not sure if the way I defined my matrices dimensions or probably the breaking points is incorrectly... Any help would be much appreciated.
I have attached my UPDATED code.
Thank you in advance.

采纳的回答

Mathieu NOE
Mathieu NOE 2020-10-12
hello
here you are .
I used interp2 function to do the interpolation. But you have to do the interpolation on each individual component of you vectors and matrices, then once you have the interpolated data, you can create your vector and matrices.
I give you the methodology for the mass (scalar) and CG (vector). If you follow the same logic, you will easily solve the problem from the inertia matrix (6 scalars to interpolate)
all the best
  3 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

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

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by