Extracting data from readtable

I am trying to import a csv file into MatLab. I can't use readcsv because the data contains headers and datetime values, and I can't use xlsread because I need to include the leading column and row. I am trying to use readtable, which is including all of the data I need, but I can't seem to get my data out of the table. This is what I'm trying to do on a table M to extract my datetime and specific column values:
t = datetime(M(2:end,1), 'ConvertFrom', 'excel');
y1 = M(2:end,120);
Please let me know where my error is!

回答 (1 件)

madhan ravi
madhan ravi 2018 年 10 月 22 日

0 投票

T = readtable('Mycsv.csv') %correct syntax

5 件のコメント

Megan Henriksen
Megan Henriksen 2018 年 10 月 22 日
Hi, this is what I am doing to import the csv file. However, I am having trouble creating separate arrays from this table.
madhan ravi
madhan ravi 2018 年 10 月 22 日
Mind uploading the data to test?
Megan Henriksen
Megan Henriksen 2018 年 10 月 22 日
I don't feel comfortable uploading the data because it is for research at my university. However, I uploaded a screenshot of what the data looks like in the table.
Jeremy Hughes
Jeremy Hughes 2018 年 10 月 22 日
If you need to extract an individual array (in a table they are the variables) use:
T.VarName
madhan ravi
madhan ravi 2018 年 10 月 22 日
Thanks Jeremy

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

質問済み:

2018 年 10 月 22 日

コメント済み:

2018 年 10 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by