view default_struct.m @ 861:607c631f175e feature/poroelastic

Small changes to Elastic2dVariable to facilitate adjoing gradient computation.
author Martin Almquist <malmquist@stanford.edu>
date Wed, 24 Oct 2018 16:17:32 -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