Hi,
I have a maximization problem which I want to solve in matlab. The problem consists of several parameters, but I am mostly interested in what happens to x when alpha increases from 0 to 0.5 with increments of 0.05. I then want to plot the value of x in a figure with x on the y-axis and alpha on the x-axis
I have defined the function in one file:
function b = maximizationpb2(x, alpha)beta1 = 6;beta2 = 6;s1 = 1/3;s2 = 1/3;s3 = 1/3;alpha = 0.5;b = -(x(1) - beta1*((x(2)-s2)^2+(1-x(1)-x(2)-s3)^2))^(1-alpha) * (x(2) - beta2*((x(1)-s1)^2+(1-x(1)-x(2)-s3)^2))^alpha;
And then I have used fmincon to solve the problem:
lb = [0,0];ub = [1,1];A = [1,1];b = [1];Aeq = [];beq = [];x0 = [1/3, 1/3];a = fmincon(@maximizationpb2,x0,A,b,Aeq,beq,lb,ub);x3 = 1 - a(1) - a(2);
My first difficulty is to make a for loop which goes through all values of alpha = 0:0.05:0.5. I have to admit I have no clue where to start (I was so happy last week when I finally managed to solve the problem!!). Any help would be very much appreicated!
Best Answer