Here is what I did from matlab console ( input.txtcontains 3 integer values):
>> f=fopen('input.txt','rt')
f =
3
>> fscanf(f,'%d')
ans =
1234
23435
888
>> fclose(f)
ans =
0
>>
Summarizing:
f=fopen('input.txt','rt');
integerList = fscanf(f,'%d');
fclose(f);
More about the features you can use doceither helpin the Matlab console:
doc fscanf
help fscanf
source
share