Mercurial > forge
changeset 1943:ec3ba064fb13 octave-forge
accepts 0 arguments
author | aadler |
---|---|
date | Thu, 12 May 2005 01:36:10 +0000 |
parents | e1327d85366a |
children | 1484eb02be3c |
files | main/struct/setfields.m |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/main/struct/setfields.m Mon May 09 16:02:33 2005 +0000 +++ b/main/struct/setfields.m Thu May 12 01:36:10 2005 +0000 @@ -30,8 +30,10 @@ ## return error rather than trapping to keyboard function s = setfields(s,varargin) -if rem(nargin,2) != 1, - error('setfields: expected struct, key1, val1, key2, val2, ...\n') ; +if nargin == 0 + s= struct; % doesn't work on older versions of octave +elseif rem(nargin,2) != 1, + error('setfields: expected struct, key1, val1, key2, val2, ...\n') ; endif for i=1:2:nargin-1