How can I solve the error "Subscripted assignment dimension mismatch."when solving a MOOP using the gamultiobj of the matlab toolbox

조회 수: 1 (최근 30일)
Dear all;
I am trying to solve a MOOP using the Matlab global optimization toolbox. some of the parameters used in the objective functions are learned from table loaded from an excel file. when I run the code from the optimization toolbox it gives me an error "Subscripted assignment dimension mismatch." Please someone can help me about this. you can find attached the code.
  댓글 수: 2
Walter Roberson
Walter Roberson 2016년 5월 18일
We need some sample data (P) and the .xlsx file to test with, and we need a complete copy of the error message.
Sobhi Barg
Sobhi Barg 2016년 5월 18일
Hi Walter, thank you for your comments. attached the excel file and a copy of the error. the data of P are:
lower: [1 0.45 1e-2 0.07e-3 1e-2 1] upper:[1e5 0.9 500e-2 7e-3 20000e-2 1000]

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

답변 (1개)

Matt Cohen
Matt Cohen 2016년 5월 19일
Hi Sobhi,
Thank you for providing the data and fitness function for reproducing this issue. One issue I am encountering right away when running this is that your fitness function currently returns a 2x2 matrix. Because of this, I am receiving the following error:
"Error running optimization. Your fitness function must return a scalar value."
In order to get this to eventually work, you will need to modify your fitness function so that it returns a scalar value instead of a matrix. I do not know more about the specific problem or fitness function you are working with, so I cannot provide much help in terms of how to fix this. Hopefully this at least points you in the right direction.
- Matt

카테고리

Help CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by