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?

Antworten (1)

Matt J
Matt J am 1 Apr. 2019
Bearbeitet: Matt J am 1 Apr. 2019
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 Kommentare

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

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 1 Apr. 2019

Kommentiert:

am 1 Apr. 2019

Community Treasure Hunt

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

Start Hunting!

Translated by