function s = emptystructarray( varargin )
    if isempty(varargin)
        s = struct();
    else
        if iscell(varargin{1})
            fields = varargin{1};
        else 
            fields = varargin;
        end
        for i=1:length(fields)
            s.(fields{i}) = [];
        end
        s = s(1:0);
    end
end
