Reading CSV file with header and other data

153 visualizaciones (últimos 30 días)
Sk Faisal Kabir
Sk Faisal Kabir el 26 de Abr. de 2022
Respondida: Johannes Hougaard el 26 de Abr. de 2022
Hi,
I need help to read the file, I am trying to extract the columns for plotting, but I do not know how to get read of the headers and other information out there in the CSV.

Respuesta aceptada

Johannes Hougaard
Johannes Hougaard el 26 de Abr. de 2022
If your header is always the same size you can simply hard code which lines are header lines (in this case 19)
datatable = readtable('UC-SR 58-28 300 S3.csv','NumHeaderLines',19);
Warning: Column headers from the file were modified to make them valid MATLAB identifiers before creating variable names for the table. The original column headers are saved in the VariableDescriptions property.
Set 'VariableNamingRule' to 'preserve' to use the original column headers as table variable names.
plot(datatable.Time_s_,datatable.AxialForce,'-.')

Más respuestas (0)

Categorías

Más información sobre Data Import and Analysis en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by