MATLAB Answers

Surrogate Optimization Error: 'Dimensions of arrays being concatenated are not consistent'

14 views (last 30 days)
Mihnea Stefan
Mihnea Stefan on 13 Mar 2021
Answered: Alan Weiss on 14 Mar 2021
Hello there, I am trying to optimize a 5 variable function using the surrogateopt algorithm in a live script using the task optimize. When I run the code the error: 'Dimensions of arrays being concatenated are not consistent' comes. What could this mean? I think it is about the intial points structure but are we required to input InitialPoints structure for the algorithm to run?
I am attaching the code of interest. Do not mind the AdiabaticReactor function, this solve an ODE System. Thank you very much for your time.

Answers (1)

Alan Weiss
Alan Weiss on 14 Mar 2021
You say "Do not mind the AdiabaticReactor function" but I cannot tell what sizes the inputs and outputs are for the objconstrAdiabticReactorSurgoate function, and your problem seems to be a size mismatch. I suggest that you use the debugger and see what sizes various inputs and outputs are, and see exactly where the dimension mismatch arises.
Alan Weiss
MATLAB mathematical toolbox documentation

Community Treasure Hunt

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

Start Hunting!