function snew = convertHDF5StrToMatlabStr(s, type)
snew = '';

if ~exist('type', 'var') || isempty(type)
    type = 'char';
end

% Convert muti-row char array to cell string array
if size(s,1)==1 && strcmp(type,'char')
    snew = strtrim_improve(s);
else
    snew = cell(size(s,1),1);
    for ii = 1:size(s,1)
        snew{ii} = strtrim_improve(s(ii,:));
    end
end

fieldtrip
github-repos/MATLAB/fieldtrip-fieldtrip/fieldtrip-c2039be598a02d86b39aae76bfa7aaa720f9801c/external/homer3/private/convertHDF5StrToMatlabStr.m
fieldtrip
github-repos/MATLAB/fieldtrip-fieldtrip
c2039be598a02d86b39aae76bfa7aaa720f9801c