Error Struct contents reference from a non-struct array object.

Hi, I have a question about the following code:
filename = 'Oefen.csv';
delimiterIn = ',';
headerlinesIn = 1;
currenciesStruct = importdata(filename,delimiterIn,headerlinesIn);
rate = currenciesStruct.data(2:end,6)
I get the following error:
Struct contents reference from a non-struct array object.
Error in nu (line 6)
rate = currenciesStruct.data(2:end,6)
How can I solve this error?

回答 (1 件)

Matt J
Matt J 2019 年 4 月 1 日
編集済み: Matt J 2019 年 4 月 1 日

0 投票

currenciesStruct is not a struct, so currenciesStruct.data cannot be understood. If you do,
>> openvar currenciesStruct
you should be able to see where your intended data resides.

2 件のコメント

Matt J
Matt J 2019 年 4 月 1 日
Cynthia replied:
Thank you! But how can I then read my file?
Matt J
Matt J 2019 年 4 月 1 日
If you do,
>> openvar currenciesStruct
you should be able to see where your intended data resides.

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

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

タグ

質問済み:

2019 年 4 月 1 日

コメント済み:

2019 年 4 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by