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: canlab_list_subjects.m
    path of file: ./repos/CanlabCore/CanlabCore/Filename_tools
    
    the code of the file until where you have to start completion: function subjects = canlab_list_subjects(basedir, varargin)
% subjects = canlab_list_subjects(basedir, wildcard1, wildcard2, etc.)
%
% Lists directories matching wildcard(s), returns cell array
% This cell array goes in EXPT.subjects in the CANlab standard
% variable/file structure.

    
function subjects = canlab_list_subjects(basedir, varargin)
% subjects = canlab_list_subjects(basedir, wildcard1, wildcard2, etc.)
%
% Lists directories matching wildcard(s), returns cell array
% This cell array goes in EXPT.subjects in the CANlab standard
% variable/file structure.
%
% e.g.,
% subjects = canlab_list_subjects(pwd, 'nsf*');
%
% This lists directory names matching nsf* OR NSF*
% subjects = canlab_list_subjects(pwd, 'nsf*', 'NSF*');

d = [];
for i = 1:length(varargin)
    d = [d; dir(fullfile(basedir, varargin{i}))];
end