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
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 Center および File Exchange で Structures についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!