view default_field.m @ 350:5d5652fe826a feature/hypsyst

A commit before I try resolving the performance issues
author Ylva Rydin <ylva.rydin@telia.com>
date Wed, 02 Nov 2016 00:02:01 +0100
parents 14bf01b7a068
children 50cafc4b9e40
line wrap: on
line source

function default_field(s, f, val)
    if isfield(s,f)
        return
    end
    s.(f) = val;
    assignin('caller', inputname(1),s);
end