You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: orderbound.m
    path of file: ./repos/lc_toolbox/3rdparty/+hinfcd/+util
    
    the code of the file until where you have to start completion: function [nb,b,i,lambda] = orderbound(P,ny,nu)
% ORDERBOUND Returns a guaranteed H-infinity controller order upperbound
%
% [nb,b,i] = ORDERBOUND(P, ny, nu) returns an upperbound nb on the 
% required controller order for the descriptor plant P with ny measured 
% outputs and nu control inputs. The output i is 0 if the (potential) 
% order reductions stem from unstable or infinite zeros in Pzu, and is 1 
% if they stem from unstable or infinite zeros in Pyw. The number of 
% potential order reductions is b. lambda is the unstable or infinite
% invariant zero corresponding to nb and b. This function implements the 
% characterization of X. Xin, S. Hara and M. Kaneda, "Reduced-Order Proper 
% H-infinity Controllers for Descriptor Systems: Existence Conditions and 
% LMI-Based Design Algorithms", IEEE Transactions on Automatic Control, 
% vol. 53, no. 5, June 2008. 

% This file is part of hinfcd.
% Copyright (c) 2019, Laurens Jacobs, MECO Research Team @ KU Leuven. 
% 
% hinfcd is free software: you can redistribute it and/or modify it under 
% the terms of the GNU Lesser General Public License as published by the 
% Free Software Foundation, version 3.
% 
% hinfcd is distributed in the hope that it will be useful, but WITHOUT ANY
% WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
% FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
% more details.
% 

    
function [nb,b,i,lambda] = orderbound(P,ny,nu)
% ORDERBOUND Returns a guaranteed H-infinity controller order upperbound
%
% [nb,b,i] = ORDERBOUND(P, ny, nu) returns an upperbound nb on the 
% required controller order for the descriptor plant P with ny measured 
% outputs and nu control inputs. The output i is 0 if the (potential) 
% order reductions stem from unstable or infinite zeros in Pzu, and is 1 
% if they stem from unstable or infinite zeros in Pyw. The number of 
% potential order reductions is b. lambda is the unstable or infinite
% invariant zero corresponding to nb and b. This function implements the 
% characterization of X. Xin, S. Hara and M. Kaneda, "Reduced-Order Proper 
% H-infinity Controllers for Descriptor Systems: Existence Conditions and 
% LMI-Based Design Algorithms", IEEE Transactions on Automatic Control, 
% vol. 53, no. 5, June 2008. 

% This file is part of hinfcd.
% Copyright (c) 2019, Laurens Jacobs, MECO Research Team @ KU Leuven. 
% 
% hinfcd is free software: you can redistribute it and/or modify it under 
% the terms of the GNU Lesser General Public License as published by the 
% Free Software Foundation, version 3.
% 
% hinfcd is distributed in the hope that it will be useful, but WITHOUT ANY
% WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
% FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
% more details.
% 
% You should have received a copy of the GNU Lesser General Public License
% along with hinfcd. If not, see <https://www.gnu.org/licenses/>.

    % get the subplants
    Pzu = P(1:(end