Home > lattice > atwritepy.m

atwritepy

PURPOSE ^

ATWRITEM Creates a .m file to store an AT structure

SYNOPSIS ^

function pyring=atwritepy(ring,filename)

DESCRIPTION ^

ATWRITEM Creates a .m file to store an AT structure

ATWRITEM(RING)
   Prints the result in the command window
ATWRITEM(RING,FILENAME)
   Prints the result in a file

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function pyring=atwritepy(ring,filename)
0002 %ATWRITEM Creates a .m file to store an AT structure
0003 %
0004 %ATWRITEM(RING)
0005 %   Prints the result in the command window
0006 %ATWRITEM(RING,FILENAME)
0007 %   Prints the result in a file
0008 
0009 if nargin>=2
0010     fid=py.open(filename,'wb');
0011     if fid==-1
0012         error('AT:FileErr','Cannot Create file %s\n%s',fn,mess);
0013     end
0014 end
0015 
0016 
0017 pyring=py.list(reshape(cellfun(@(elem) at2py(elem), ring, 'UniformOutput', false),1,[]));
0018 
0019 if nargin>=2
0020     py.pickle.dump(pyring, fid, 2);
0021     fid.close();
0022 end
0023 end
0024

Generated on Thu 24-Aug-2017 18:47:33 by m2html © 2005