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: a_fft.m
    path of file: ./repos/d2d/arFramework3/ThirdParty/StrucID/adimat/runtime
    
    the code of the file until where you have to start completion: % function adj = a_fft(adj, ind, a, n, dim)
%
% Compute adjoint of z = fft(x, n?, dim?).
%
% see also a_ifft
%
% This file is part of the ADiMat runtime environment
%
% Copyright 2013 Johannes Willkomm, Institute for Scientific Computing
%                     TU Darmstadt
function adj = a_fft(adj, ind, a, n, dim)
  if nargin < 5
    if isscalar(a
    
function adj = a_fft(adj, ind, a, n, dim)
%
% Compute adjoint of z = fft(x, n?, dim?).
%
% see also a_ifft
%
% This file is part of the ADiMat runtime environment
%
% Copyright 2013 Johannes Willkomm, Institute for Scientific Computing
%                     TU Darmstadt
function adj = a_fft(adj, ind, a, n, dim)
  if nargin < 5
    if isscalar(a)
      dim = 2; 
    else
      dim = adimat_first_nonsingleton(a);
    end