diff --git a/classes/@Rocket/Rocket.m b/classes/@Rocket/Rocket.m index b904ff43fb486dffea4585a0cfe4097d1b946563..019b1377061a0a6c30efa744bed452d0c4b019ce 100644 --- a/classes/@Rocket/Rocket.m +++ b/classes/@Rocket/Rocket.m @@ -171,15 +171,8 @@ classdef Rocket < Config case 'Yes' parserPath = fullfile(mission.msaPath, 'autoMatricesProtub'); addpath(genpath(parserPath)); - mainAutoMatProtub(obj); - - obj.coefficients = Coefficient( ... - fullfile(mission.dataPath, 'aeroCoefficients.mat'), ... - coeffName); - - obj.coefficientsHighAOA = Coefficient( ... - fullfile(mission.dataPath, 'aeroCoefficientsHighAOA.mat'), ... - coeffName); + [obj.coefficients, obj.coefficientsHighAOA] = ... + mainAutoMatProtub(obj); case 'Cancel' error('Rocket creation aborted') otherwise diff --git a/classes/misc/Coefficient.m b/classes/misc/Coefficient.m index 4af9ad6b61167ebe9edd68f1bed5917beaf987fd..f7eb51b09518ae3395228fd0af572ef5f7ac421e 100644 --- a/classes/misc/Coefficient.m +++ b/classes/misc/Coefficient.m @@ -112,7 +112,7 @@ classdef Coefficient % the specified xcg. Dynamic derivatives are included only if % loadDynamic is true. - if ~obj.isReady, error('Canno interpolate coefficients: check that all dimensions match'); end + if ~obj.isReady, error('Cannot interpolate coefficients: check that all dimensions match'); end coefficients = zeros(11, 1); coefficients(1:6) = obj.staticInterpolant(alpha, mach, beta, altitude, airbakes); @@ -138,11 +138,12 @@ classdef Coefficient end function value = get.static(obj) + if isempty(obj.TOTAL), value = []; return; end value = obj.TOTAL([1, 3, 5, 6, 9, 13], :, :, :, :, :, 1); end function value = get.dynamic(obj) - if ~obj.isDynamic, value = []; return; end + if ~obj.isDynamic || isempty(obj.TOTAL), value = []; return; end value = obj.TOTAL([7, 10, 11, 14, 15], :, :, :, :, :, :); end