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일
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

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.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

태그

질문:

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