view default_struct.m @ 1263:117bc4542b61 feature/poroelastic

Add helper function for 2d Lebedev grid
author Martin Almquist <malmquist@stanford.edu>
date Wed, 29 Apr 2020 21:04:06 -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