フィルターのクリア

Info

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

Can't retrieve array content, just metadata

1 回表示 (過去 30 日間)
Mak
Mak 2017 年 5 月 29 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi everyone!
I have a task where I need to open a csv file and extract and manipulate the data. I have now tried with the comands: importdata, fopen, load and several others. However, I keep only getting info about the data aray, but can't actually access the data i.e. I get lines like: [8x1 double] but never the actual content. What am I doing wrong? Here's an example:
filename = 'efhk_weather_data_14_15.csv';
delimiterIn = ',';
headerlinesIn = 1;
A = importdata(filename,delimiterIn,headerlinesIn);
A
As a result I get the text: A =
data: [398x1 double]
textdata: {399x23 cell}
Thanks a lot!
  1 件のコメント
Stephen23
Stephen23 2017 年 5 月 29 日
編集済み: Stephen23 2017 年 5 月 29 日
@Mak: that is the data. To prevent printing masses of unreadable text MATLAB conveniently does not display non-scalar arrays within container variables. But your data is most certainly there.
"but can't actually access the data": it is easy to access it, e.g.:
A.data(1) % the first element in |data|

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 5 月 29 日
The actual numeric content is stored at A.data . You also appear to have a bunch of text data.
You should consider using readtable() if you have R2013b or later.

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

Community Treasure Hunt

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

Start Hunting!

Translated by