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: istft.m
    path of file: ./repos/CellExplorer/toolboxes/+iosr/+dsp
    
    the code of the file until where you have to start completion: function [x,t] = istft(s,nfft,hop,fs)
%ISTFT Calculate the Inverse Short-Time Fourier Transform
%   
%   X = IOSR.DSP.ISTFT(S) calculates the inverse short-time Fourier
%   transform (ISTFT), from the 1024-point one-sided FFTs in each column of
%   S, using the overlap-add method. It is assumed that FFTs are calculated
%   in steps of HOP=512. X is a column vector of length (HOP*K)+(NFFT-HOP)
%   where K is SIZE(X,2).
% 
%   X = IOSR.DSP.ISTFT(S,NFFT) uses FFT-length NFFT and HOP=FIX(NFFT/2).
% 
%   X = IOSR.DSP.ISTFT(S,NFFT,HOP) uses the hop size HOP.
% 
%   [X,T] = IOSR.DSP.ISTFT(S,NFFT,HOP,FS) returns the corresponding time T
%   (seconds) for each element of X based on sampling frequency FS.
% 
%   Example
% 

    
function [x,t] = istft(s,nfft,hop,fs)
%ISTFT Calculate the Inverse Short-Time Fourier Transform
%   
%   X = IOSR.DSP.ISTFT(S) calculates the inverse short-time Fourier
%   transform (ISTFT), from the 1024-point one-sided FFTs in each column of
%   S, using the overlap-add method. It is assumed that FFTs are calculated
%   in steps of HOP=512. X is a column vector of length (HOP*K)+(NFFT-HOP)
%   where K is SIZE(X,2).
% 
%   X = IOSR.DSP.ISTFT(S,NFFT) uses FFT-length NFFT and HOP=FIX(NFFT/2).
% 
%   X = IOSR.DSP.ISTFT(S,NFFT,HOP) uses the hop size HOP.
% 
%   [X,T] = IOSR.DSP.ISTFT(S,NFFT,HOP,FS) returns the corresponding time T
%   (seconds) for each element of X based on sampling frequency FS.
% 
%   Example
% 
%       % create a spectrogram using a Hann window
%       % and convert back to the time domain
%       load handel.mat
%       nfft = 1024;
%       hop = 128;
%       Y = iosr.dsp.stft(y,hann(nfft),hop);
%       z = iosr.dsp.istft(Y,nfft,hop);
% 
%   See also IOSR.DSP.STFT.

%   Copyright 2016 University of Surrey.

    %% check input
    
    assert(ismatrix(s), 'iosr:istft:invalidS', 'S must be a matrix')
    
    % check nfft
    if nargin<2
        nfft = 1024;
    else
        assert(isscalar(nfft) && round(nfft)==nfft && nfft>0, 'iosr:istft:invalidNfft', 'NFFT must be a positive scalar integer')
    end