Mercurial > repos > public > sbplib
diff Dictionary.m @ 832:5573913a0949 feature/burgers1d
Merged with default, and updated +scheme/Burgers1D accordingly
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Tue, 11 Sep 2018 15:58:35 +0200 |
parents | ba0fee896b41 |
children |
line wrap: on
line diff
--- a/Dictionary.m Tue Sep 11 13:24:08 2018 +0200 +++ b/Dictionary.m Tue Sep 11 15:58:35 2018 +0200 @@ -98,14 +98,11 @@ % Should probably use mat2str with some kind of normalization to make all variables valied fieldname % and make it possible to recover the value function fName = getFieldname(obj, val) - if isnumeric(val) - valStr = num2str(val); - elseif ischar(val) - valStr = val; - else - error('Dont know what to do with val!'); + if ~ischar(val) + val = toString(val); end - fName = sprintf('f%s',valStr); + + fName = matlab.lang.makeValidName(val); end end end \ No newline at end of file