function D = transferData(D,S)
% Helper function for LOADOBJ.
% Transfers data from structure S to object D for fields common to S and D.

%   Copyright 1986-2013 The MathWorks, Inc.
f = intersect(fieldnames(D),fieldnames(S));
for ct=1:numel(f)
   D.(f{ct}) = S.(f{ct});
end
