Mercurial > repos > public > sbplib
comparison Dictionary.m @ 820:501750fbbfdb
Merge with feature/grids
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 07 Sep 2018 14:40:58 +0200 |
parents | ba0fee896b41 |
children |
comparison
equal
deleted
inserted
replaced
819:fdf0ef9150f4 | 820:501750fbbfdb |
---|---|
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 |