comparison Dictionary.m @ 427:a613960a157b feature/quantumTriangles

merged with feature/beams
author Ylva Rydin <ylva.rydin@telia.com>
date Thu, 26 Jan 2017 15:59:25 +0100
parents ba0fee896b41
children
comparison
equal deleted inserted replaced
426:29944ea7674b 427:a613960a157b
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