readmatrix() returning “NaN” for all data cells
I have run into some trouble using the "readmatrix" function and was wondering if anyone has any insights. I am trying to plot a comparison between a 2D airfoil’s Cp distribution as a function of %chord and my aircraft’s 3D Cp as a %chord (at a given span position) from XFLR5’s .txt files.
When my 3D aircraft does not have wing flaps, the readmatrix function works perfectly; however, when I use the file with flaps I get a column of NaNs as my matrix output. The two files are almost identical spare a few lines close to the start, leading me to be very confused why the second txt file cannot be properly interpreted with the readmatrix() function. Additionally, I don’t need any of the data before the y-span row. I have tried other methods such as "readcell" and "readtable" but those either don’t work or intrepret the data imporperly. Does anyone have any suggestions?
Thanks!
Here is how I call each of these (pardon my variable naming convention)
"Aoa3MainWing…" is the file which is working correctly and "MainWing…" is the one with errors
Below Screenshots the working file (Aoa3MainWing…)
Above: txt file for no flaps
Above: datafile after readmatrix()
Below Screenshots of the non-working file (MainWing…)
Above: txt file for flaps (only difference ,aside from data values, is "Main WingFlap…" and "Flap 2 Moment…" lines being added)
Above: datafile after readmatrix() producing only a column of NaNsI have run into some trouble using the "readmatrix" function and was wondering if anyone has any insights. I am trying to plot a comparison between a 2D airfoil’s Cp distribution as a function of %chord and my aircraft’s 3D Cp as a %chord (at a given span position) from XFLR5’s .txt files.
When my 3D aircraft does not have wing flaps, the readmatrix function works perfectly; however, when I use the file with flaps I get a column of NaNs as my matrix output. The two files are almost identical spare a few lines close to the start, leading me to be very confused why the second txt file cannot be properly interpreted with the readmatrix() function. Additionally, I don’t need any of the data before the y-span row. I have tried other methods such as "readcell" and "readtable" but those either don’t work or intrepret the data imporperly. Does anyone have any suggestions?
Thanks!
Here is how I call each of these (pardon my variable naming convention)
"Aoa3MainWing…" is the file which is working correctly and "MainWing…" is the one with errors
Below Screenshots the working file (Aoa3MainWing…)
Above: txt file for no flaps
Above: datafile after readmatrix()
Below Screenshots of the non-working file (MainWing…)
Above: txt file for flaps (only difference ,aside from data values, is "Main WingFlap…" and "Flap 2 Moment…" lines being added)
Above: datafile after readmatrix() producing only a column of NaNs I have run into some trouble using the "readmatrix" function and was wondering if anyone has any insights. I am trying to plot a comparison between a 2D airfoil’s Cp distribution as a function of %chord and my aircraft’s 3D Cp as a %chord (at a given span position) from XFLR5’s .txt files.
When my 3D aircraft does not have wing flaps, the readmatrix function works perfectly; however, when I use the file with flaps I get a column of NaNs as my matrix output. The two files are almost identical spare a few lines close to the start, leading me to be very confused why the second txt file cannot be properly interpreted with the readmatrix() function. Additionally, I don’t need any of the data before the y-span row. I have tried other methods such as "readcell" and "readtable" but those either don’t work or intrepret the data imporperly. Does anyone have any suggestions?
Thanks!
Here is how I call each of these (pardon my variable naming convention)
"Aoa3MainWing…" is the file which is working correctly and "MainWing…" is the one with errors
Below Screenshots the working file (Aoa3MainWing…)
Above: txt file for no flaps
Above: datafile after readmatrix()
Below Screenshots of the non-working file (MainWing…)
Above: txt file for flaps (only difference ,aside from data values, is "Main WingFlap…" and "Flap 2 Moment…" lines being added)
Above: datafile after readmatrix() producing only a column of NaNs readmatrix, data import MATLAB Answers — New Questions