I’m trying to load a large text file into MATLAB. The file has the following format:
567.1 339.8 13923645.0 1.3 0.6
568.0 338.5 13923646.0 1.8 0.9
569.4 336.9 13923647.0 2.4 1.1
570.8 337.1 13923648.0 3.3 1.0
570.8 338.8 13923649.0 4.3 0.6
This is meant to be imported as a [:,5] array. However, I’m using the command:
inputData = fscanf(fid, '%g\t').';
This causes the numbers to imported as a one-dimensional vector:
inputData = [567.1 339.8 13923645.0 1.3 0.6 568.0 338.5 13923646.0 1.8 0.9 ... etc]
How do I get it to retain its 5 column structure?
Try using the
loadcommand. It is the easiest in this case