Use Textscan or sscanf?
Mostra commenti meno recenti
My data :)
1 764.2981300 3 0 25 103
1 764.2981300 3 0 25 103
1 764.2981300 3 0 25 103
* Gp# 5[2,1,3,4,6] x = 51.26, y = 149.1, z = 43.3, q = 0.885 dT[ 1, 18, 24, 59] Src Amplitude = 38.3
1 764.2981300 3 0 25 103
1 764.2981300 3 0 25 103
* Gp# 5[2,1,3,4,6] x = 51.26, y = 149.1, z = 43.3, q = 0.885 dT[ 1, 18, 24, 59] Src Amplitude = 38.3
Hi all,
Thanks in advance for your help.
I am loading text files with lines similar to these. The first 3 lines (Set 1) will always have this structure (different numbers). Another set (* Gp#) will be similar to the ones shown. I used fgetl to grab each line and place it in a cell{k,1} because I do not know how many times Set 1 will appear between (* Gp#) lines.
To read the first line I have tried
jj = sscanf('%d%c%d%c%d%c%d%c%d%c%d',string), resulting in jj = ' '
Is this sscanf-able?
I thought about textscan(fid), but since the lines change randomly between one format and another, I am not sure how to do so.
Any general advice?
Regards,
John
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Sources 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!