SOFAcheckFilename('filename') works as expected. (although there is a problem with file names shorter than 7 characters due to the implmentation of checking for remote files ... this should be reworked as well.)
SOFAcheckFilename("filename") fails with "Filename must be a string.". This is due to strings and character vectors apparently being different things in Matlab. heavy eye rolling.
The function can be made work with strings in the following way. I didn't bother to make a PR (yet), since I don't know if you would want to make a proper rework of the function (i.e. not losing backwards compatibility towards Matlab versions before R2016b and being more error proof in general.
% filename = string?
if isstring(fn)
fn = char(fn);
end
if ~ischar(fn)
error('Filename must be a string.');
end
SOFAcheckFilename('filename')
works as expected. (although there is a problem with file names shorter than 7 characters due to the implmentation of checking for remote files ... this should be reworked as well.)SOFAcheckFilename("filename")
fails with "Filename must be a string.". This is due to strings and character vectors apparently being different things in Matlab. heavy eye rolling.The function can be made work with strings in the following way. I didn't bother to make a PR (yet), since I don't know if you would want to make a proper rework of the function (i.e. not losing backwards compatibility towards Matlab versions before R2016b and being more error proof in general.