フィルターのクリア

I am unable to import my csv

2 ビュー (過去 30 日間)
ramakrishna yellapragada
ramakrishna yellapragada 2023 年 10 月 15 日
コメント済み: 鑫源 2023 年 10 月 15 日
I am unable to import my csv

回答 (2 件)

Dyuman Joshi
Dyuman Joshi 2023 年 10 月 15 日
移動済み: Image Analyst 2023 年 10 月 15 日
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

鑫源
鑫源 2023 年 10 月 15 日
the filename better be an absolute path, rather than a short form.(like C:\**\**.csv
You can use readcsv or readtable
  2 件のコメント
Image Analyst
Image Analyst 2023 年 10 月 15 日
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.
鑫源
鑫源 2023 年 10 月 15 日
thank you for correction. You 're right

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAdding custom doc についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by