fscanf import txt file

1 view (last 30 days)
Loretta
Loretta on 18 Jan 2016
Hello everyone,I have a complex txt file: PS=220,1422,STA1,0,2,0,1,120,120,0,0
C=34755
T=09/04/2015 10:08:49.000 9
U=3.31,4.81,12.38,23.75
L=-9668
L=-9665
L=-9664
L=-9672
L=-9663
L=-9658
L=-9643
.....
The txt file includes both characters and numbers. I wanto to import the txt file (as an array) in matlab and save only a range of lines. I'm using the following: fileID=fopen('myfile.txt');
A=fscanf(fileID,'%s\n%s\n%s%s\n%g');
but probably I'm wrong somenthing...
Please can you give me suggestions?? many thanks

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!