view default_struct.m @ 939:46f5dc61d90b feature/utux2D

Update Schrodinger2d to work with new interface types, similar to LaplCurv.
author Martin Almquist <malmquist@stanford.edu>
date Tue, 04 Dec 2018 14:25:03 -0800
parents 46256fffa329
children
line wrap: on
line source

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