Reputation: 881
I have a file with a numbers separated by line. I would like to scan an entire file say input.txt, and put the numbers into a vector.
I have a basic idea of how to do it but I do not know how to iterate until the end of the file.
The language is Matlab.
Thank you in advance!
Upvotes: 1
Views: 620
Reputation: 283614
Try the textscan
or fscanf
functions. Both can read an entire matrix at one go.
Upvotes: 1