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: uistack2.m
    path of file: ./repos/mpsim/lib/plot
    
    the code of the file until where you have to start completion: function uistack2(h,opt,step)


    
function uistack2(h,opt,step)

% UISTACK2 Restacks objects.
%
%   UISTACK2(H,STACKOPT,STEP) where STACKOPT is 'up','down','top' or
%   'bottom' modifies the visual stacking order of objects with handles H.
%   STEP is the distance to move 'up' and 'down'.
%
%   UISTACK2(H,STACKOPT) use default value STEP=1
%
%   All handles, H, must have the same parent.
%
%   UISTACK2('undo') sets previous visual stacking order back. UISTACK2(H,...) 
%   must be obviously used first.
%  
%   When using array of handles H, the final ordering will always be : 
%   first element of H --> toppest moved objects, last element of H -> lowest 
%
%   UISTACK2 treats handles as individual entities. Be careful
%   when using UISTACK2 with objects created by functions that may return 
%   multiple handles (PLOT, LINE...)
%
%   UISTACK2 is based on the Matlab® UISTACK function (by Loren Dean). It solves 
%   the problem illustrated by the example below :
%
%       figure
%       subplot(2,1,1);
%       plot([1 5],[2 7]);
%       p=patch([2 4 4 2],[3 3 4 4],'r');
%       uistack(p,'bottom'); % the red patch SHOULD be placed under the blue line
%       title('UISTACK behavior')
%       subplot(2,1,2);
%       plot([1 5],[2 7]);
%       p=patch([2 4 4 2],[3 3 4 4],'r');
%       uistack2(p,'bottom'); % the red patch IS placed under the blue line
%       title('UISTACK2 behavior')

%   Author: Jérôme
%   Contact: dutmatlab@yahoo.fr
%   Version: 1.2 (07 Aug 2006)
%   Comments:
%

if nargin==0 % UISTACK2
    
    error('No enough input argument')
    
elseif nargin==1 % UISTACK2('undo')
    
    if ~strcmpi(h,'undo')
        
        error('Single input argument should be ''undo''')
        
    else h=[];
         opt='undo';

    end