optimization of simulink parameters using genetic algorithm in the optimization toolbox
7 次查看(过去 30 天)
显示 更早的评论
i am trying to optimise two parameters (x and k) in a simulink model using ga(genetic algorithm) solver in the optimization toolbox.my objective function is minimising the squared error between the output from simulink and observed value.Following is the objective function ; function F =tracklsqga(v,input) x=v(1) k=v(2) opt=simset('solver','ode5','SrcWorkspace','Current') sim('model',[0 240],opt) F=(observed-outflow2.signals.values).^2
But it shows error message as "Invalid matrix-format variable specified as workspace input in 'model/From Workspace'. The matrix must have two dimensions and at least two columns. Complex signals of any data type and non-double real signals must be in structure format. The first column must contain time values and the remaining columns the data values" i have tried the 'input'(an input to simulink model to be given from workspace) in array format and structure format.but the same error message is coming.can anybody help me?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Genetic Algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!