Textscan Reads Only the first 3 numbers
Mostra commenti meno recenti
Hello,
I´m trying to read this .txt (attached) file and store the values (54 columuns).
This is the code that I´m using
Name_1 = 'fffff.txt';
fid = fopen(Name_1,'r');
cell_data1= textscan(fid,'%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f','Delimiter','','headerLines',6,'CollectOutput',1);
fclose(fid);
But unfortunately the code is messing with the first two columns (data and time).
This is what it stores.

How can I skip those two and just store the remaining 52 columns?
Thanks in advance
2 Commenti
Look at the file —
C1 = readcell('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1136490/fffff.txt')
There does not appear to be anything in the file (other than a few dates and some integer values). There are 6 header lines, then a date (best read as a string or as a date — see Nonnumeric Fields in the formatSpec section of the documentation) and a single integer.
Fabio Taccaliti
il 26 Set 2022
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Text Files in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
