Import numerical data from .dat file maintaining small values (instead of 0's)
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jasmine Alvarez
el 6 de Sept. de 2019
Respondida: Walter Roberson
el 6 de Sept. de 2019
I am required to use the .dat files provided to us (for airfoils) in the code. However, when I use the code below, all of the x-coordinates are turned to 0's since they're all small numbers. How can I import them without MATLAB recognizing them as 0's? Further, why are only the x-coordinates appearing as 0's when the rest of the numbers are all quite small as well?
x = dlmread('NACA0012_5deg.dat',' ',3,0)
I attached a .csv file of the data because .dat files are not supported. If a .csv file will maintain the digits then how to convert .dat to .csv in matlab?
0 comentarios
Respuesta aceptada
Walter Roberson
el 6 de Sept. de 2019
I recommend against using dlmread() for this purpose. I suggest
x = readmatrix('NACA0012_5deg.dat', 'filetype', 'text');
if you have R2019a or later. If you have an earlier release, then
x = table2array(readtable('NACA0012_5deg.dat', 'filetype', 'text'));
For your purposes you might want to remove the first column.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Workspace Variables and MAT Files en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!