Mercurial > repos > public > sbplib
comparison default_struct.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 | 46256fffa329 |
| children |
comparison
equal
deleted
inserted
replaced
| 816:b5e5b195da1e | 886:8894e9c49e40 |
|---|---|
| 1 function default_struct(s, val) | |
| 2 if evalin('caller',sprintf('~exist(''%s'',''var'')',s)) | |
| 3 given = []; | |
| 4 else | |
| 5 given = evalin('caller', s); | |
| 6 end | |
| 7 | |
| 8 final = copyWithDefault(given, val); | |
| 9 assignin('caller', s, final); | |
| 10 end |
