Borrar filtros
Borrar filtros

I am unable to import my csv

2 visualizaciones (últimos 30 días)
ramakrishna yellapragada
ramakrishna yellapragada el 15 de Oct. de 2023
Comentada: 鑫源 el 15 de Oct. de 2023
I am unable to import my csv

Respuestas (2)

Dyuman Joshi
Dyuman Joshi el 15 de Oct. de 2023
Movida: Image Analyst el 15 de Oct. de 2023
It's working here, see below. So, there seems no problem with the file.
How are you reading the file?
Is the file in the current folder? Use the command "pwd" to check what the current folder is.
y = readtable('air-quality-india.csv')
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.
y = 36192×6 table
Timestamp Year Month Day Hour PM2_5 ____________________ ____ _____ ___ ____ ______ 07-Nov-2017 12:00:00 2017 11 7 12 64.51 07-Nov-2017 13:00:00 2017 11 7 13 69.95 07-Nov-2017 14:00:00 2017 11 7 14 92.79 07-Nov-2017 15:00:00 2017 11 7 15 109.66 07-Nov-2017 16:00:00 2017 11 7 16 116.5 07-Nov-2017 17:00:00 2017 11 7 17 124.21 07-Nov-2017 18:00:00 2017 11 7 18 123.45 07-Nov-2017 19:00:00 2017 11 7 19 120.31 07-Nov-2017 20:00:00 2017 11 7 20 108.75 07-Nov-2017 21:00:00 2017 11 7 21 97.8 07-Nov-2017 22:00:00 2017 11 7 22 88.1 07-Nov-2017 23:00:00 2017 11 7 23 81.64 08-Nov-2017 00:00:00 2017 11 8 0 83.82 08-Nov-2017 01:00:00 2017 11 8 1 85.14 08-Nov-2017 02:00:00 2017 11 8 2 90.41 08-Nov-2017 03:00:00 2017 11 8 3 105.33

鑫源
鑫源 el 15 de Oct. de 2023
the filename better be an absolute path, rather than a short form.(like C:\**\**.csv
You can use readcsv or readtable
  2 comentarios
Image Analyst
Image Analyst el 15 de Oct. de 2023
There is no readcsv, though there is a deprecated csvread which is recommended not to use. I think you meant to use readmatrix or readtable.
Also, specifying the full file name (folder plus base file name plus extension) is a good idea. Use fullfile to do that.
鑫源
鑫源 el 15 de Oct. de 2023
thank you for correction. You 're right

Iniciar sesión para comentar.

Categorías

Más información sobre Adding custom doc 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!

Translated by