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: pop_fourierp.m
    path of file: ./repos/erplab/pop_functions
    
    the code of the file until where you have to start completion: % PURPOSE  :	Calculates the FFT power spectrum of an ERP dataset
%
% FORMAT   :
%
% pop_fourierp(ERP, chanArray, 
    
function does not work with multiple ERPsets';
            errorfound(msgboxText, title_msg);
            return
      end
      if ~strcmpi(datatype, 'ERP')
            msgboxText =  'This ERPset is already converted into frequency domain!';
            errorfound(msgboxText, title_msg);
            return
      end
      
      defx = {1 1 0 ERP.srate/2 512 [ERP.xmin ERP.xmax]*1000 1};
      def  = erpworkingmemory('pop_fourierp');
      
      if isempty(def)
            def = defx;
      end