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: importsii.m
    path of file: ./repos/VAD/lib/matlab/voicebox
    
    the code of the file until where you have to start completion: function q=importsii(f,m)
%IMPORTSII calculates the SII importance function per Hz or per Bark Q=(F,M)
% Inputs:
%        f(n)   Frequencies to which to calculate importance in Hz
%               or Bark according to 'b' flag.
%        m      Mode string with some of the following flags:
%                'b'  Frequencies given in Bark rather than Hz
%                'c'  Calculate cumulative importance for f<f(i)
%                'd'  Calculate importance of n-1 bands: band i is f(i) to f(i+1)
%                'h'  Ca
    
function is zero outside the range [1.286 21.948] bark or [130.1 9361]
% Hz.
%
% References:
%  [1]  Methods for the calculation of the speech intelligibility index.
%       ANSI Standard S3.5-1997 (R2007), American National Standards Institute, 1997.
%  [2]  C. V. Pavlovic. Derivation of primary parameters and procedures for use in
%       speech intelligibility predictions. J. Acoust Soc Amer, 82: 413–422, 1987.

%	   Copyright (C) Mike Brookes 2006
%      Version: $Id: importsii.m 5099 2014-09-09 14:39:17Z dmb $
%
%   VOICEBOX is a MATLAB toolbox for speech processing.
%   Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   This program is free software; you can redistribute it and/or modify
%   it under the terms of the GNU General Public License as published by
%   the Free Software Foundation; either version 2 of the License, or
%   (at your option) any later version.
%
%   This program 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 General Public License for more details.
%
%   You can obtain a copy of the GNU General Public License from
%   http://www.gnu.org/copyleft/gpl.html or by writing to
%   Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

persistent mi ci ai bi xi0 xi1
if isempty(mi)
    % cumulative importance function =  mi*b+c+ai*(b<4)*(b-4)^2-bi*(b>18)*(b-18)^2
    % for x in (xi0,xi1)
    ci4=0.0783;
    ci18=0.8861;
    mi=(ci18-ci4)/14;
    ci=ci4-4*mi;
    ai=mi^2/(4*(4*mi+ci));
    bi=mi^2/(4*(1-18*mi-ci));
    xi0=4-mi/(2*ai);
    xi1=18+mi/(2*bi);
end
if nargin<2
    m=' ';
end
if any(m=='b')
    b=f;
else
    [b,d]=frq2bark(f);
end