フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Is it possible to import both the text and the numerical data in a csv file?

1 回表示 (過去 30 日間)
Pratik Samant
Pratik Samant 2020 年 2 月 28 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I have a csv file that looks like this
where I have some data that is a string and some data that is numerical. I would like to import this data into MATLAB. In python I can easily do this with a pandas dataframe, but is there a way to load this data into matlab such that both the strings and numbers are read? I would prefer not to have to access the numerical colums separately from the string columns but if this is the only way that is fine. I have tried readMatrix but this labels all the strings as NaN and does away with them.
Thanks in advance
  2 件のコメント
Adam
Adam 2020 年 2 月 28 日
Does
doc readtable
not do this? I don't work with Excel spreadsheets in Matlab so I don't know, but this seems to be the obvious choice amongst the recommended alternatives to
doc xlsread
Pratik Samant
Pratik Samant 2020 年 2 月 28 日
Readtable did the trick! Thank you, I had not heard of this function before.

回答 (0 件)

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by