view default_struct.m @ 1084:d5290a056049 feature/laplace_curvilinear_test

Fix bug in new implementations that made matrices non-sparse.
author Martin Almquist <malmquist@stanford.edu>
date Wed, 27 Mar 2019 15:56:42 -0700
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