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: realpow.m
    path of file: ./repos/chebfun/@chebfun
    
    the code of the file until where you have to start completion: function Z = realpow(X, Y)
%REALPOW   Real power of a CHEBFUN.
%   Z = REALPOW(X, Y) is the same as X.^Y.  An error is produced if the result
%   is complex.
%
% See also CHEBFUN/POWER, REALPOW.

% Copyright 2017 by The University of Oxford and The Chebfun Developers. 
% See http://www.chebfun.org/ for Chebfun information.

    
function Z = realpow(X, Y)
%REALPOW   Real power of a CHEBFUN.
%   Z = REALPOW(X, Y) is the same as X.^Y.  An error is produced if the result
%   is complex.
%
% See also CHEBFUN/POWER, REALPOW.

% Copyright 2017 by The University of Oxford and The Chebfun Developers. 
% See http://www.chebfun.org/ for Chebfun information.

Z = power(X, Y);
        
% Check for complex Z:
if ( ~isreal(Z) )
    error('CHEBFUN:CHEBFUN:realpow:complexRes', ...
        'REALPOW produced complex result.');
end