Reading text data from a CSV file in MATLAB
问题 my data is in following form: days of week date time(hrs) visitors mon jan 2 2010 900 501 mon jan 2 2010 1000 449 mon jan 2 2010 1100 612 likewise for every day for entire year. i need to create a matrix of days of week as shown below: A=[ mon mon mon ] 回答1: Here is how I would read the tab-separated values , and parse the dates: %# read and parse file fid = fopen('data.csv','rt'); C = textscan(fid, '%s %s %s %d', 'Delimiter','\t', 'HeaderLines',1, ... 'MultipleDelimsAsOne',true,