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

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.

 Accepted Answer

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

More Answers (0)

Categories

Products

Release

R2019b

Asked:

on 9 Oct 2020

Commented:

J
J
on 13 Oct 2020

Community Treasure Hunt

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

Start Hunting!