This is the problem I need help with:
equation:
r = a1*x1 + a2*x2 + a3*x3 + a4*x4,
where ‘x1,x2,x3,x4’ are scores (all positive) for four aspects of a product;
‘a1,a2,a3,a4’ are initialized weights (sum of them is 1);
‘r’ is calculated as the final score for this product;
Say the number of products are 100; then based on the final score “r”, sort the 100 products and calculate the equally weighted profit (given) of the top 10 products.
The purpose is to find the maximum value of the weighted profit by changing the weights ‘a1,a2,a3,a4’.
Does the Matlab toolbox has the function to solve it? I have searched several, but didn’t find right one for this problem. Any suggestion will be appreciated!
Create a function that calculates the negative of the weighted profit (negative because matlab’s built-in algorithms find the minimum). If I understand what you’re describing, it should look something like this.
Then use fmincon to find the minimum.