Importdata for a text file isn't importing all the data.

4 次查看(过去 30 天)
So, I am trying to import some text files and then write them to csv files but the importdata is not importing the entire text file.
importdata('NACA644421_test.txt')
is what I am using.
what is imported is a 1x1 struct with a 4x2 textdata cell and a 1x1 value. I made it look like code so you could see how the text file is delimited.
4x2 textdata:
'Xfoil polar. Reynolds number fixed. Mach number fixed ' ''
'Polar key xf-naca644421-il-1000000-n5 ' ''
'Airfoil' 'naca644421-il'
'Reynolds number' ''
1x1 value:
1000000
Below is the text file
Xfoil polar. Reynolds number fixed. Mach number fixed
Polar key xf-naca644421-il-1000000-n5
Airfoil naca644421-il
Reynolds number 1000000
Ncrit 5
Mach 0
Max Cl/Cd 112.47
Max Cl/Cd alpha 6.25
Url http://www.airfoiltools.com/polar/csv?polar=xf-naca644421-il-1000000-n5
Alpha Cl Cd Cdp Cm Top_Xtr Bot_Xtr
-19.75 -1.0946 0.07661 0.07229 -0.0649 1 0.0205
-19.5 -1.0934 0.07371 0.06932 -0.066 1 0.0208
-19.25 -1.0917 0.07086 0.06642 -0.067 1 0.021
-19 -1.0888 0.06821 0.06371 -0.0678 1 0.0211
-18.75 -1.086 0.06561 0.06105 -0.0686 1 0.0213
-18.5 -1.0813 0.06325 0.05864 -0.0693 1 0.0216
-18.25 -1.0775 0.06081 0.05613 -0.07 1 0.0217
-18 -1.0706 0.05876 0.05404 -0.0705 1 0.0219
-17.75 -1.0665 0.0564 0.05163 -0.0711 1 0.0221
-17.5 -1.0623 0.05414 0.04933 -0.0716 1 0.0224
-17.25 -1.0576 0.05193 0.04709 -0.072 1 0.0227
-17 -1.0508 0.04999 0.04511 -0.0724 1 0.0229
-16.75 -1.0437 0.04809 0.04317 -0.0726 1 0.0231
-16.5 -1.0249 0.04594 0.04099 -0.0751 0.9626 0.0236
-16.25 -0.9801 0.04354 0.03852 -0.0832 0.9497 0.0241
-16 -0.9313 0.04123 0.0361 -0.092 0.9329 0.0246
-15.75 -0.8981 0.0395 0.03419 -0.0969 0.8996 0.0251
-15.5 -0.8867 0.03825 0.03278 -0.0969 0.8711 0.0253
-15.25 -0.8787 0.03688 0.0313 -0.0965 0.852 0.0257
-15 -0.8709 0.03553 0.02985 -0.096 0.8368 0.0261
-14.75 -0.8623 0.03427 0.02851 -0.0955 0.8222 0.0265
-14.5 -0.8528 0.03305 0.02722 -0.095 0.8094 0.0269
Any help is appreciated, Thanks.

采纳的回答

KSSV
KSSV 2017-9-15
YOu can use readtable or a textscan. In textscan you can mention header lines and read only data. Read about textscan and readtable.

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by