I have a ASCII file with measurments of a signal. I want to import the data in Matlab and plot the resulting curve. The thing is that the file contains at least 100k values. I wonder if Matlab has any limitation problems with this? I tried this:
------------------------------
clear all;
global arrays, double(i);
fid=fopen('usart.txt');
for i=1:100000
tline = fgetl(fid);
if ~ischar(tline)
break
end
if str2num(tline)
arrays(i)=str2num(tline);
else
i=i-1;
end
end
fclose(fid);
arrays=arrays(find(arrays));
plot(arrays)
------------------------------
I can plot up to app.2000 values but thats it. I get this error message:
??? In an assignment A(I) = B, the number of elements in B and
I must be the same.
Error in ==> C:\rs232 med 18f2455\test.m
On line 10 ==> arrays(i)=str2num(tline);
Any suggestions? Is this the right way to inport large values?? Thanks in advance.
------------------------------
clear all;
global arrays, double(i);
fid=fopen('usart.txt');
for i=1:100000
tline = fgetl(fid);
if ~ischar(tline)
break
end
if str2num(tline)
arrays(i)=str2num(tline);
else
i=i-1;
end
end
fclose(fid);
arrays=arrays(find(arrays));
plot(arrays)
------------------------------
I can plot up to app.2000 values but thats it. I get this error message:
??? In an assignment A(I) = B, the number of elements in B and
I must be the same.
Error in ==> C:\rs232 med 18f2455\test.m
On line 10 ==> arrays(i)=str2num(tline);
Any suggestions? Is this the right way to inport large values?? Thanks in advance.