Attempt to refrence field of non structured array
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
Hello,
I am new to MATLAB and I am trying to use the MOGA tool for optimization. When I run the optimization I get the following error
??? Attempt to reference field of non-structure array.
Error in ==> gamultiobjsolve at 28
state.Generation = state.Generation + 1;
Error in ==> gamultiobj at 240
[x,fval,exitFlag,output,population,scores] = gamultiobjsolve(FitnessFcn,nvars, ...
It would be great if you could help me out.
0 个评论
回答(1 个)
Jan
2012-11-12
Please post how you call the function. It seems like the varaible "state" should be a struct, but it has another type.
A general method to identify such problems is using the debugger:
dbstop if error
Then start the program again and Matlab stops, when the error occurres. Now you can inspect the calling tree and the values of the locally used variables.
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!