Quantcast
Viewing latest article 1
Browse Latest Browse All 3

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 lines. Note however, that textscan allocates memory for the number of lines you provide (1000 here), so you want to choose something "wise" there.


Viewing latest article 1
Browse Latest Browse All 3

Trending Articles



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