Effacer les filtres
Effacer les filtres

Error whilst using textscan function to read data

1 vue (au cours des 30 derniers jours)
Hamza
Hamza le 9 Jan 2014
Modifié(e) : Hamza le 9 Jan 2014
Hi Everyone,
I am trying to extract data using the textscan function.
After I open the data_file.txt file, Matlab is happy to read in the Mach and Incidence values (lines 6 to 8 in matlab script and line 992 in data file) as well as the Lift and Moment Coeff. (Lines 10-12). The problem starts at line 14, for some reason Matlab does not continue to read the data file ( Error: Index exceeds matrix dimensions. Error in test (line 15) data.CDP = number{1}(1)).
However, if I first close and then open the file again and set HeaderLines to the correct value to read CDP, it works. It also works if I ignore lines 10-12 and go straight to line 14.
I was wondering if there is a way to avoid having to keep opening and closing the data file but this seems to be the only way to get the script to run.
Thank you in advance,
Hamza

Réponses (0)

Catégories

En savoir plus sur Large Files and Big Data dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by