Info
この質問は閉じられています。 編集または回答するには再度開いてください。
"Attempt to reference field of non-structure array" error in cell2mat function
1 回表示 (過去 30 日間)
古いコメントを表示
In my dynamic programming code, all values in each step are scalar except one which is a cell. This cell is generated in a main code and the dynamic programming uses this cell in another function, but I get this error: "Attempt to reference field of non-structure array". Any help?
0 件のコメント
回答 (1 件)
Image Analyst
2015 年 6 月 26 日
You make it really difficult to do without code. As far as I know, only Walter had the Mind Reading Toolbox so far. Until the rest of us get it, read this http://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer
Chances are you're doing something like
value = myStruct.myField;
and the variable myStruct of yours is not a structure, and so has no fields. So you can't reference the .myField field of it. If you had posted the complete error message ( ALL the red text), instead of just a small snippet excerpted from it, then you'd probably have your answer by now.
2 件のコメント
Walter Roberson
2015 年 6 月 26 日
Your dynb is either one of the arguments passed in or else it is calculated from the arguments. We do not know which. However it is being created, it is not a structure when it is expected to be.
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!