I'm just having a small issue with my code. The code reads a file, plots the data and closes. Simple right? Well, the code is over 500000+ lines long, and after 5000 points, a new line begins. I keep getting the error "Subscript indices must either be real positive integers or logicals" for when I run this. The data goes down in one straight column, with no line separation, like this:
4567
This is what the code looks like:
fid = fopen('***.dat');p = fscanf(fid, '%g',[1,inf])';x=1:1:5000;y=p(:,1);for i=1:100; plot(x,y((i-1)*5000:i*5000),'g') hold allendplot(x(1:1:5000),y(500001:505001),'b') %Last line is special, so it is separate
axis([0 5000 0 100])fid=fclose(fid);
Is there some obvious flaw I'm overlooking? Thanks.
Best Answer