Quantcast
Channel: How do I read several lines in Matlab with textscan? - Stack Overflow
Browsing all 3 articles
Browse latest View live

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 Article



Answer 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 Article

How 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
Browsing all 3 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>