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: pspm_interp1.m
    path of file: ./repos/PsPM/src
    
    the code of the file until where you have to start completion: function Y = pspm_interp1(varargin)
% ● Description
%   pspm_interp1 is a shared PsPM function for interpolating data with NaNs
%   based on the reference of missing epochs and first order interpolation.
% ● Format
%   Y = pspm_interp1(varargin)
% ● Arguments
%   X:              data that contains NaNs to be interpolated
%   index_missing:  index of missing epochs with the same size of X in binary
%                   values. 1 if NaNs, 0 if non-NaNs.

    
function Y = pspm_interp1(varargin)
% ● Description
%   pspm_interp1 is a shared PsPM function for interpolating data with NaNs
%   based on the reference of missing epochs and first order interpolation.
% ● Format
%   Y = pspm_interp1(varargin)
% ● Arguments
%   X:              data that contains NaNs to be interpolated
%   index_missing:  index of missing epochs with the same size of X in binary
%                   values. 1 if NaNs, 0 if non-NaNs.
%   Y:              processed data
% ● History
%   Introduced in PsPM 6.1
%   Written in 2023 by Teddy Chao (UCL)

%% 1 Load inputs
switch nargin
  case 1
    X = varargin{1};
    index_missing = zeros(size(X));
  case 2
    X = varargin{1};
    index_missing = varargin{2};
  otherwise
    warning('ID:invalid_input','pspm_interp1 accepts up to two arguments');
end