Borrar filtros
Borrar filtros

I have a text file containing certain story that i want to read using Matlab. How can i do that?

2 visualizaciones (últimos 30 días)
I have a text file containing
"In [7] genetic algorithm is combined with neural network for intrinsic plagiarism detection. Approach of [7] consists of two parts: document pre-processing and neural network evolution. During pre-processing several stylometric features such as Number of punctuation marks, Sentence length (number of characters), Sentence word frequency class, etc. are extracted and an average document wide value for each features are calculated."
I want to read that text file using Matlab. How can i do that??
Thanks

Respuestas (1)

dpb
dpb el 22 de Dic. de 2014
Depends on what you want/need to do with it once you've read it...
As a cell array of strings, one cell/line
file = textread('filename.txt','%s','delimiter','\n','whitespace','');
As a cell array, one cell of size number of space-delimited words...
fid=fopen('filename.txt','r');
file=textscan(fid,'%s','collectoutput',true);
As a character image array...
fid=fopen('filename.txt','r');
file=fread(fid,[],'*char');

Categorías

Más información sobre String Parsing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by