Hi there.<br><br>My program reads data from a file with 12 columns of hex numbers.<br><br>The input part is like:<br>while(done==0)<br> [num_read, val(1),val(2),val(3),val(4),val(5),val(6),val(7),val(8),val(9),val(10),val(11),val(12)] = mfscanf(fid, "%x %x %x %x %x %x %x %x %x %x %x %x");<br>
if(num_read>=0) then<br>...<br>...<br>else done=1<br>end<br>end<br>mclose(fid);<br><br>Such program has been working fine until today when I tried reading a new data file with absolutely no difference in format. Scilab keeps reporting error_21 (invalid index) about one line in the form of "abc = val(1)+val(2)+ ... val(12)". But I can't see anything wrong with that. More interestingly, it worked ok when I limited the program to only read the first, say 100, lines. <br>
<br>So would anybody kindly point out what I am doing wrong? Thanks very much.<br><br>Regards,<br><br>Peng<br>