MATLAB Answers

How can i create a term document matrix?

7 views (last 30 days)
ellis on 11 Mar 2015
Commented: Stephen Cobeldick on 11 Mar 2015
I have a directory containing 141 files and i need to make a term document matrix. Can anyone help me please? thanks in advance
this is my inital code to get the files
dirinformation = dir('*.txt'); filenames = {}; data = cell(numel(filenames),2); data(:,1) = regexprep(fileNames, '.txt','');
for i = 1:length(fileNames) fid = fopen(char(fileNames{i})); data{ii,2} = textscan(fid,'%s','delimiter', '. ; , * : /'); end

  1 Comment

Stephen Cobeldick
Stephen Cobeldick on 11 Mar 2015
Please edit your code to be more readable by editing the question and using the {} Code button that you will find above the textbox.

Sign in to comment.

Answers (0)

Sign in to answer this question.