↧
Answer by gzm0 for How do I read several lines in Matlab with textscan?
Use the following:fh = fopen('indices.txt');resC = textscan(fh, '%d %d %d %d %d %d %d %s', 1000);res = cell2mat(resC(1:7))fclose(fh);textscan will only read (and return) up to the available number of...
View ArticleAnswer by alrikai for How do I read several lines in Matlab with textscan?
For this case, you can do the following:fid = fopen('indices.txt');num_ints = 7;num_rows = 4;format = [repmat('%d ', 1, num_ints), '%s'];weights = textscan(fid, format, num_rows);weights =...
View ArticleHow do I read several lines in Matlab with textscan?
I used this : weights=fopen('indices.txt');weights=textscan(weights, '%d %d %d %d %d %d %d')but this only reads the first line of my file.my file looks like this :0 90 100 5 0 0 0 (class)19 5 0 0 0 0 0...
View Article