Code covered by the BSD License  

Highlights from
Statistical Learning Toolbox

from Statistical Learning Toolbox by Dahua Lin
Functions for statistical learning, pattern recognition and computer vision, covering many topics.

Description of slwritetext
Home > sltoolbox > fileio > slwritetext.m

slwritetext

PURPOSE ^

SLWRITETEXT Writes a text to file

SYNOPSIS ^

function slwritetext(T, filename)

DESCRIPTION ^

SLWRITETEXT Writes a text to file

 $ Syntax $
   - slwritetext(T, filename)

 $ Arguments $
   - T             the cell array representing the text
   - filename      the path of the file to write to

 $ Description $
   - slwritetext(T, filename) Writes in a text file stored in a cell array 
   to a text file specified by filename.

 $ History $
   Created by Dahua Lin, on 2005-06-02

CROSS-REFERENCE INFORMATION ^

This function calls:
This function is called by:

SOURCE CODE ^

0001 function slwritetext(T, filename)
0002 %SLWRITETEXT Writes a text to file
0003 %
0004 % $ Syntax $
0005 %   - slwritetext(T, filename)
0006 %
0007 % $ Arguments $
0008 %   - T             the cell array representing the text
0009 %   - filename      the path of the file to write to
0010 %
0011 % $ Description $
0012 %   - slwritetext(T, filename) Writes in a text file stored in a cell array
0013 %   to a text file specified by filename.
0014 %
0015 % $ History $
0016 %   Created by Dahua Lin, on 2005-06-02
0017 %
0018 
0019 if ~iscell(T)
0020     error('T should be a text cell array');
0021 end
0022 fid = fopen(filename, 'w');
0023 if (fid <= 0)
0024     error(['Fail to open ', filename]);
0025 end
0026 
0027 n = length(T);
0028 for i = 1 : n
0029     fprintf(fid, '%s\r\n', T{i});
0030 end
0031     
0032 fclose(fid);

Generated on Wed 20-Sep-2006 12:43:11 by m2html © 2003

Contact us at files@mathworks.com