view general/getparam.m @ 9:45aaf9b2d7b0

Moved high-order sequence/list functions to @cell class.
author samer
date Mon, 14 Jan 2013 15:49:04 +0000
parents 47cb292350f3
children beb8a3f4a345
line wrap: on
line source
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 prefs.

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