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

조회 수: 1 (최근 30일)
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

답변 (1개)

dpb
dpb 2014년 12월 22일
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');

카테고리

Help CenterFile Exchange에서 String Parsing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by