I have a function of 3 variables stored in vector x and I am looking for its minimum
x0 = [20 20 20];lb = [0 0 0];ub = [100 100 100];fun = @(x) x(1)+x(2)+x(3)x_min = fmincon(fun,x0,[],[],[],[],lb,ub)
It works correctly. Now I want to "freeze" x(2) at value of 40 and find the minimum (with only x(1) and x(3) as variables). How to do this?
Best Answer