function xdr2mat(xdrfile,matfile)

% XDR2MAT	Conversion from XDR file to MAT file
%   XDR2MAT XDRFILE MATFILE converts the XDR-file XDRFILE to a MAT file
%   MATFILE.
%
% [+GenLib General Purpose Library+] Swiss Plasma Center EPFL Lausanne 2022. All rights reserved.

[VALUES__,list] = loadxdr(xdrfile,1);
CMD1__ = '';
CMD2__ = ['save ' matfile];
for k = 1:length(list)
 CMD1__ = [CMD1__ list{k} '=VALUES__{' int2str(k) '};'];
 CMD2__ = [CMD2__ ' ' list{k}];
end
eval(CMD1__)
eval(CMD2__)
