Hi All,
I am trying to read 150 text files. Each contains the value of x and y. x is the input of an experiment and y is the measured value. Each experiment has different number of data. The number of data cannot be determined until I have read each file.
How should I use the arrays which store x and y in a for-loop efficiently to speed up the process of reading? How should I initialize them while each experiment has different number of elements? I tried to use a code similar to the following code.
x=zeros(??,150);y=zeros(??,150);for i=1:150 fid=fopen(fname); data=textscan(fid,'%f %f'); x(??,i)=data{1} y(??,i)=data{2}end
By ?? I mean I don't exactly know what to use. Could someone please help me?
Thanks.
Best Answer