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?

 채택된 답변

Torsten
Torsten 2022년 5월 3일

0 개 추천

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Portfolio Optimization and Asset Allocation에 대해 자세히 알아보기

제품

릴리스

R2020a

질문:

2022년 5월 3일

답변:

2022년 5월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by