function workDir = validateWorkDir(workDir)
    % Verify dir input.
    if isstring(workDir)
        workDir = char(workDir);
    end
    if isempty(workDir)
        error(exampleUtils.em('EmptyDirectory'));
    elseif ~ischar(workDir)
        error(exampleUtils.em('InvalidDirectory'));
    elseif any(workDir < 32)
        error(exampleUtils.em('UnsupportedDirectoryName'));
    end
end
