Matlab .txt file analyses
问题 I am analyzing a set of text in a .txt file. the file has 30 lines and each line contains different phrases both containing text, numbers, and symbols. what's the best way to import this file into Matlab for analyses (i.e.: how many Capital I's are in the text file or how many #text phrases are in the file (analyzing tweets on each line) 回答1: I think you'd best read the file line-by-line and save each line in a cell of a cell array: fid = fopen(filename); txtlines = cell(0); tline = fgetl(fid