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: aas_addtask.m
    path of file: ./repos/automaticanalysis/aa_engine
    
    the code of the file until where you have to start completion: % Automatic analysis - add a task to tasklist
% Called mainly by aap_tasklist but also by user scripts
% Third parameter is prefix for input EPIs if they are taken
% function [aap]=aas_addtask(aap,taskname[,epiprefix[,tobecompletedfir
    
function [aap]=aas_addtask(aap,taskname[,epiprefix[,tobecompletedfirst]][,extraparameters])
% 
%  extraparameters (which is a structure) may be specified without other
%  preceding string parameters epiprefix and tobecompletedfirst
%
%  Examples of usage:    
%   aap=aas_addtask(aap,'aamod_smooth');
%
%   extraparameters=[];
%   extraparameters.aap.tasksettings.aamod_smooth=14;
%   aap=aas_addtask(aap,'aamod_smooth',extraparameters);
%
%   aap=aas_addtask(aap,'aamod_smooth','wuf','aamod_realign');
%

function [aap]=aas_addtask(aap,taskname,varargin)
v=varargin;
if (~isempty(v) && isstruct(v{end