Home > data-utility > scantext.m

scantext

PURPOSE ^

SYNOPSIS ^

function data = scantext(filename, delimiter, numheaders, fmt)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function data = scantext(filename, delimiter, numheaders, fmt)
0002 if ~exist('numheaders', 'var') || isempty(numheaders)
0003     numheaders = 0;
0004 end
0005 
0006 if ~exist('fmt', 'var') || isempty(fmt)
0007     fmt = scanformat(filename, delimiter, numheaders);
0008 end
0009 
0010 fid = fopen(filename, 'rb');
0011 for n = 1:numheaders
0012     fgets(fid);
0013 end
0014 
0015 data = textscan(fid, fmt, Inf, 'Delimiter', delimiter);
0016 fclose(fid);
0017 end

Generated on Tue 23-May-2017 02:00:59 by m2html © 2005