My text file is like this:-
3
2
3
-1
2
3.5
I'm doing it like this :-
fileID=fopen('sample.txt','r');
formatSpec='%d';
A=[ ];
A=fscanf(fileID,formatSpec,sizeA)
disp(A)
I am assuming array A is created and it is reading byte by byte into A for some reason nothing is printing. Also i need help because it would stop reading at -1 becausr it is a negative value. How can i read different data types ? i want to store them into a array after reading from a file.
Best Answer