view default_arg.m @ 150:d5a794c734bc feature/grids

Starting branch for adding abstract classes for grids, grid functions as well as implementing plotting and error calculation for these.
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 21 Dec 2015 15:06:16 +0100
parents 48b6fb693025
children
line wrap: on
line source

function default_arg(s, val)
    if evalin('caller',sprintf('~exist(''%s'',''var'') || isempty(%s)',s,s))
        assignin('caller',s,val)
    end
end