function subdirectories = getSubdirectories(directoryPath)
    % Check if the input is a valid directory
    if ~isfolder(directoryPath)
        error('Input is not a valid directory.');
    end
    
    % Get a list of all items in the directory
    items = dir(directoryPath);
    
    % Filter out non-directory items
    subdirectories = {items([items.isdir]).name};
    
    % Remove '.' and '..' from the list
    subdirectories = subdirectories(~ismember(subdirectories, {'.', '..'}));
end
