function a=getparam(s,field,def)
% getparam - get value of named field or default if not present
%
% getparam :: struct Fields, string~'field name', A~'default value' -> A.
%
% Typical usage is with structures returned by options.

if isfield(s,field), a=s.(field); else a=def; end

