function [channels] = loadChannels(path, filenamesTDMS, filenamesCSV)

    channels = {};

    % read TDMS file headers
    for i = 1:length(filenamesTDMS)
        channel = tdmsinfo(append(path, '\', filenamesTDMS(i).name)).ChannelList;
        channel = channel{:, "ChannelName"};
        channels{i} = channel;
    end
    
    % read CSV file headers
    for i = length(filenamesTDMS) + 1:length(filenamesCSV) + length(filenamesTDMS)   
        channel = readtable(strcat(path, '\', filenamesCSV(i - length(filenamesTDMS)).name), ...
            'VariableNamingRule','preserve');
        channel = channel.Properties.VariableNames;
        channel = string(channel);
        channels{i} = channel.';
    end
end