Mercurial > repos > public > sbplib
diff default_struct.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 | 46256fffa329 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/default_struct.m Thu Jan 26 15:59:25 2017 +0100 @@ -0,0 +1,10 @@ +function default_struct(s, val) + if evalin('caller',sprintf('~exist(''%s'',''var'')',s)) + given = []; + else + given = evalin('caller', s); + end + + final = copyWithDefault(given, val); + assignin('caller', s, final); +end