Find matrix that maximizes formula output.
Show older comments
rates = [ 0.0174 0.0188 0.0186 0.0173 0.0192 0.0179 0.0192 0.0185 0.0175 0.0196 0.0184 0.0195 0.0187 0.0178 0.0199 0.0187 0.0199 0.0189 0.0182 0.0203 0.0188 0.0204 0.0191 0.0186 0.0208 0.0190 0.0210 0.0194 0.0189 0.0212 0.0191 0.0215 0.0196 0.0193 0.0216 0.0192 0.0217 0.0196 0.0196 0.0219 0.0193 0.0220 0.0197 0.0200 0.0220 0.0194 0.0000 0.0198 0.0203 0.0223 0.0194 0.0000 0.0199 0.0204 0.0225 0.0195 0.0000 0.0200 0.0207 0.0226];
weights = [ 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000];
yield = sum(sum(rates.* weights)) * 100;
It needs to change the weights to an optimal array that maximizes the yield formula. I've tried the fmin functions, I've tried the linprog function, I attempted simulink... just don't know how to make it use a matrix as the changing variable.
EX: in Excel, solver will return this matrix to maximize yield.
weights = [ 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.2675 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.3000];
Accepted Answer
More Answers (1)
Damani Brown
on 26 Jul 2018
Edited: Damani Brown
on 26 Jul 2018
2 Comments
Damani Brown
on 26 Jul 2018
Damani Brown
on 30 Jul 2018
Edited: Damani Brown
on 30 Jul 2018
Categories
Find more on Solver Outputs and Iterative Display in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!