필터 지우기
필터 지우기

dynamic variable error 'Argument to dynamic structure reference must evaluate to a valid field name'

조회 수: 1 (최근 30일)
Hi,
I get this error message appearing from the line indicated. Can anyone suggest why this might be happening? Thanks!
i=xD20V10sweep3rd.(2); i=i(1920);
v=xD20V10sweep3rd.(1); v=v(1920);
c7d_20V=i/v;
i=xD20V10sweep3rd.(2); i=i(1894);
v=xD20V10sweep3rd.(1); v=v(1894);
c7d_10V=i/v;
i=xD20V5sweep3rd.(2); i=i(1881); <----------------------------------error source
v=xD20V5sweep3rd.(1); v=v(1881);
c7d_5V=i/v;
i=xD20V10sweep3rd.(2); i=i(1881);
v=xD20V10sweep3rd.(1); v=v(1881);
c7d_5V=i/v;
c7d=(c7d_20V/c7d_5V)-1
I find this error message really strange because the previous identical code is not causing any error messages and I ran a almost identical code (different mathematical operator) and no error message resulted!
EDIT:
I solved this by just using table2array and dealing with an array instead.
  댓글 수: 1
Mohith Kulkarni
Mohith Kulkarni 2020년 11월 25일
Could you provide a detailed explanation along with the code you have tried so that we can replicate the issue. what does the "xD20V5sweep3rd" variable contain. The error usually happens when indexing into a structure with an invalid field name.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Debugging and Analysis에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by