Interpolation of a table (N dependent over M independent) variables
2 views (last 30 days)
Show older comments
I have the given table:
% AoA vel CDa CLa CSa Cmxa Cmya Cmza
-40 5 1.14668 -1.13299 0.007386 -0.00189 0.00032 -0.06785
-30 5 0.792945 -1.05145 0.001173 0.000308 -0.00066 -0.05284
-20 5 0.46091 -0.9383 0.004354 -0.00228 -0.00047 -0.03891
-10 5 0.176381 -0.70155 -0.0037 0.000787 2.33E-07 -0.02382
10 5 0.189115 1.388965 -0.00634 0.002562 -0.00117 0.024032
15 5 0.309158 1.551853 -0.00271 5.05E-05 0.000825 0.033537
20 5 0.640063 1.489591 -0.02716 0.006253 -0.00117 0.038003
30 5 0.843689 1.382815 0.004803 -0.00204 -0.00216 0.050888
45 5 1.435123 1.337931 -0.01323 0.001252 -0.00139 0.069426
-40 10 1.135769 -1.12232 0.008136 -0.00338 0.000516 -0.13411
-30 10 0.786587 -1.04173 0.000678 0.001555 -0.00207 -0.10408
-20 10 0.454954 -0.93194 0.002149 -0.00573 -0.00102 -0.07623
-10 10 0.17226 -0.70207 -0.0055 0.001301 0.000137 -0.04808
10 10 0.185599 1.40734 -0.0057 0.001352 -0.00197 0.047792
15 10 0.302297 1.554765 -0.00804 0.000129 -0.00238 0.068301
20 10 0.635433 0.917047 -0.02498 0.007075 -0.00257 0.089213
30 10 0.840859 1.379861 0.008731 -0.00259 -0.00295 0.101972
45 10 1.600783 1.628605 -0.00913 0.000973 -0.0029 0.073734
-40 15 1.134235 -1.12156 0.008302 -0.00298 0.00131 -0.13368
-30 15 0.78341 -1.0394 0.0019 0.001564 -0.00192 -0.10364
-20 15 0.456106 -0.93554 0.003156 -0.00523 -0.00066 -0.07602
-10 15 0.17026 -0.69772 -0.0069 0.00247 0.000491 -0.04811
10 15 0.183753 1.411952 -0.00514 0.001282 -0.0019 0.047676
15 15 0.306336 1.572716 -0.02108 -0.00823 -0.00079 0.068636
20 15 0.446206 1.49619 -0.02127 0.004692 -0.00195 0.075722
30 15 0.794182 1.287936 0.024425 -0.00247 -0.00354 0.119258
45 15 1.564058 1.411367 -0.01153 0.00088 -0.0027 0.158261
-40 20 1.130857 -1.11942 0.011118 -0.00251 0.001287 -0.13325
-30 20 0.783355 -1.03969 0.001792 0.001849 -0.00195 -0.10357
-20 20 0.453382 -0.93397 0.004538 -0.00527 -0.00116 -0.07611
-10 20 0.169203 -0.70222 -0.00304 0.001263 -0.00043 -0.04776
10 20 0.182575 1.414132 -0.00465 0.001476 -0.00181 0.047619
15 20 0.302945 1.557986 -0.02611 -0.01088 -0.00131 0.069002
20 20 0.441594 1.667185 -0.03727 0.018395 -0.001 0.085187
30 20 0.833129 1.367756 0.021856 -0.00202 -0.00372 0.100927
45 20 1.414648 1.322671 -0.01084 0.000713 -0.00222 0.137053
-40 25 1.130254 -1.11854 0.011035 -0.0026 0.001291 -0.13307
-30 25 0.78033 -1.03801 0.006084 0.001668 -0.00065 -0.10342
-20 25 0.454824 -0.93126 -3.40E-06 -0.00521 -0.00019 -0.07559
-10 25 0.167459 -0.69818 -0.0036 0.002762 0.000251 -0.04732
10 25 0.181822 1.416205 -0.00467 0.001572 -0.00181 0.047616
15 25 0.307287 1.595218 -0.01342 -0.00625 -0.00398 0.072986
20 25 0.449001 1.491301 -0.03155 0.01809 -0.00051 0.074918
30 25 0.853412 1.258704 0.017987 -0.00277 -0.00635 0.089384
45 25 1.543683 1.460518 -0.01509 -0.00111 -0.00411 0.14807
-40 30 1.125591 -1.11304 0.00975 -0.0033 0.001251 -0.13249
-30 30 0.780225 -1.0392 0.007942 0.002208 -0.00092 -0.10343
-20 30 0.453074 -0.9373 0.002856 -0.00568 -0.00058 -0.07605
-10 30 0.166888 -0.7011 -0.00378 0.002011 6.89E-05 -0.04708
10 30 0.181113 1.41787 -0.00429 0.001623 -0.00172 0.04744
15 30 0.309359 1.560654 -0.01769 -0.00408 -0.00315 0.073177
20 30 0.424315 1.507518 -0.0368 0.019651 -0.0007 0.076681
30 30 0.829189 1.368019 0.008733 -0.00308 -0.00554 0.100652
45 30 1.416077 1.324257 -0.01235 -0.00132 -0.00327 0.137079
-40 35 1.128033 -1.11649 0.009527 -0.00154 0.000553 -0.06634
-30 35 0.781222 -1.04085 0.003488 0.001143 -0.00094 -0.05175
-20 35 0.452797 -0.93978 0.003031 -0.0029 -0.0004 -0.03791
-10 35 0.16714 -0.70461 6.22E-05 0.000711 -0.00057 -0.02364
10 35 0.180499 1.418791 -0.00459 0.000791 -0.0009 0.02378
15 35 0.303655 1.545379 -0.01416 -0.00088 -0.0001 0.035761
20 35 0.477813 1.317009 -0.03607 0.011042 0.000731 0.036779
30 35 0.833212 1.306725 -0.01089 -0.00047 -0.00033 0.048257
45 35 1.387943 1.286388 -0.01112 -0.00306 -0.00334 0.060734
-40 40 1.130903 -1.12077 0.008338 -0.00266 0.001092 -0.13321
-30 40 0.779686 -1.03895 0.007888 0.002269 -0.00089 -0.10334
-20 40 0.450783 -0.93033 0.000821 -0.00456 0.00064 -0.07527
-10 40 0.166252 -0.70388 -0.00162 0.001372 -0.00043 -0.04719
10 40 0.180017 1.420129 -0.00468 0.001581 -3.60E-05 0.047408
15 40 0.302535 1.530176 -0.00861 0.005485 -0.00278 0.071903
20 40 0.447166 1.489379 -0.03367 0.020146 0.003072 0.074659
30 40 0.831837 1.375903 -0.01245 7.12E-05 -0.00282 0.10027
45 40 1.41966 1.329288 -0.00866 -0.00745 -0.00655 0.137312
Independent variables:
, 
Dependent variables:
,
,
,
,
, 
So far I have the solution for the any of dependent variables, e.g. for
:
AoA = [-40, -30, -20, -10, 10, 15, 20, 30, 45]; % 9 elements
vel = [5, 10, 15, 20, 25, 30, 35, 40]; % 8 elements
CDa = [1.14668, 0.792945, 0.46091, 0.176381, 0.189115, 0.309158, 0.640063, 0.843689, 1.435123,
1.135769, 0.786587, 0.454954, 0.17226, 0.185599, 0.302297, 0.635433, 0.840859, 1.600783,
1.134235, 0.78341, 0.456106, 0.17026, 0.183753, 0.306336, 0.446206, 0.794182, 1.564058,
1.130857, 0.783355, 0.453382, 0.169203, 0.182575, 0.302945, 0.441594, 0.833129, 1.414648,
1.130254, 0.78033, 0.454824, 0.167459, 0.181822, 0.307287, 0.449001, 0.853412, 1.543683,
1.125591, 0.780225, 0.453074, 0.166888, 0.181113, 0.309359, 0.424315, 0.829189, 1.416077,
1.128033, 0.781222, 0.452797, 0.16714, 0.180499, 0.303655, 0.477813, 0.833212, 1.387943,
1.130903, 0.779686, 0.450783, 0.166252, 0.180017, 0.302535, 0.447166, 0.831837, 1.41966]; % 72 elements
CDa_i = griddata (AoA, vel, CDa, -35, 7); % interpolated however only one column, namely CDa
So I need to transform every dependent variable (column) into 1D-array size of (NxM) and use griddata
This could be done for all columns but the process is tedious and error-prone.
I need somewhat like: [
,
,
,
,
,
] = interpNxM(
,
);
The question: Does a simpler solution exist?
0 Comments
Answers (0)
See Also
Categories
Find more on Map Display in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!