expwrite

PURPOSE ^

EXPWRITE - write an Argus file from a structure given in input

SYNOPSIS ^

function expwrite(a,filename);

DESCRIPTION ^

EXPWRITE - write an Argus file from a structure given in input

   This routine write an Argus file form a structure containing the fields:
   x and y of the coordinates of the points.
   The first argument is the structure containing the points coordinates 
   and the second one the file to be write.

   Usage:
      expwrite(a,filename)
 
   Example:
      expwrite(coordstruct,'domainoutline.exp')

   See also EXPDOC, EXPREAD, EXPWRITEASVERTICES

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function expwrite(a,filename);
0002 %EXPWRITE - write an Argus file from a structure given in input
0003 %
0004 %   This routine write an Argus file form a structure containing the fields:
0005 %   x and y of the coordinates of the points.
0006 %   The first argument is the structure containing the points coordinates
0007 %   and the second one the file to be write.
0008 %
0009 %   Usage:
0010 %      expwrite(a,filename)
0011 %
0012 %   Example:
0013 %      expwrite(coordstruct,'domainoutline.exp')
0014 %
0015 %   See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
0016 
0017 fid=fopen(filename,'w');
0018 for n=1:length(a),
0019    
0020    if ~isempty(a(n).name),
0021        fprintf(fid,'%s%s\n','## Name:',a(n).name);
0022    else
0023        fprintf(fid,'%s\n','## Name:');
0024    end
0025    
0026    fprintf(fid,'%s\n','## Icon:0');
0027    fprintf(fid,'%s\n','# Points Count  Value');
0028    fprintf(fid,'%i %f\n',[length(a(n).x) a(n).density]);
0029    fprintf(fid,'%s\n','# X pos Y pos');
0030 
0031    for i=1:length(a(n).x),
0032          fprintf(fid,'%f %f\n',[a(n).x(i) a(n).y(i)]);
0033    end  
0034    fprintf(fid,'\n','');
0035    
0036 end
0037 fclose(fid);

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003