comparison Dictionary.m @ 886:8894e9c49e40 feature/timesteppers

Merge with default for latest changes
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Thu, 15 Nov 2018 16:36:21 -0800
parents ba0fee896b41
children
comparison
equal deleted inserted replaced
816:b5e5b195da1e 886:8894e9c49e40
96 end 96 end
97 97
98 % Should probably use mat2str with some kind of normalization to make all variables valied fieldname 98 % Should probably use mat2str with some kind of normalization to make all variables valied fieldname
99 % and make it possible to recover the value 99 % and make it possible to recover the value
100 function fName = getFieldname(obj, val) 100 function fName = getFieldname(obj, val)
101 if isnumeric(val) 101 if ~ischar(val)
102 valStr = num2str(val); 102 val = toString(val);
103 elseif ischar(val)
104 valStr = val;
105 else
106 error('Dont know what to do with val!');
107 end 103 end
108 fName = sprintf('f%s',valStr); 104
105 fName = matlab.lang.makeValidName(val);
109 end 106 end
110 end 107 end
111 end 108 end