Optimisation using intlinprog for a portfolio

here is the code i am using (adapted from the matlab intlinprog page):
clc
clear all
close all
f = [100 60 70 65 50 50 45 40 40 30];
b = [100];
N=10;
lb = zeros(N,1);
ub = ones(N,1);
intcon = 1:N;
A = [61 28 33 30 25 17 25 12 16 10];
[x1,fval1,exitflag1,output1] = intlinprog(f,intcon,[],[],A,b,lb,ub)
Question:
I am using the above code to try and maximise the profit of a portfolio for a project. I have a bughet (b) of £100 million with 10 projects with their individual costs (A). The profit to be made from each project is displayed in (f). The problem requires me to find the maximum profit for £100 million and £110 million. When I chnage b to 110 I get a profit (fval1) less than when I enter 100. I believe the code is finding a protfolio that adds upto exaclty 100 and 110 million rather than finding the max profit for each budget.
Any idea how to fix this?

 Accepted Answer

[x1,fval1,exitflag1,output1] = intlinprog(-f,intcon,A,b,[],[],lb,ub)

More Answers (0)

Categories

Products

Release

R2020a

Community Treasure Hunt

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

Start Hunting!