Helper to set default values (if not already set) of parameter struct. Takes a struct prm and a list of 'name'/default pairs, and for each 'name' for which prm has no value (prm.(name) is not a field) getPrmDflt assigns the given default value. If default value for variable 'name' is 'REQ', and prm.name is not a field, an error is thrown. See example below for usage details. USAGE prm = getPrmDflt( prm, dfs ) INPUTS prm - parameters struct dfs - cell of form {name1,default1,name2,default2,...} OUTPUTS prm - updated parameters struct EXAMPLE dfs = { 'x','REQ', 'y',0, 'z',[], 'eps',1e-3 }; prm.x = 1; prm = getPrmDflt( prm, dfs ) See also