% eval_fields - Apply function to all member fields of structure
%
% eval_fields ::
%    struct(fields(N,A{:}->B)),
%    A{:},
% -> struct(fields(N,B)).
%
% fields(N,A) denotes a list of struct field type declarates with
% names from list N and types all equal to A, eg
%    fields({'a','b','c'},real) == {a::real, b::real, c::real}.

function x=eval_fields(y,varargin)
	args=varargin;
	x=map_fields(@(f)feval(f,args{:}),y);
