function st = Static(F,G,Hstat,LON) % Static Response to Controls and Two Commands st = 1; if det(F) ~= 0 if max(size(F)) ~= max(size(Hstat)) 'Hstat is not conformable with F' end if LON >=1 Gstat = G; % Longitudinal Control Effect Gstat(:,4) = []; % Retain elevator and throttle Gstat(:,3) = []; else Gstat = G; % Lateral-Directional Control Effect Gstat(:,3) = []; % Retain ailerons and rudder end Finv = inv(F); nFinvG = -Finv * Gstat B22inv = Hstat * nFinvG; if det(B22inv) ~= 0 B22 = inv(B22inv) B12 = nFinvG * B22 else 'No static command response because B22 is singular' end else 'No static control response because F is singular' end