필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Help with optimizing a function.

조회 수: 1 (최근 30일)
Marianne
Marianne 2013년 11월 8일
마감: MATLAB Answer Bot 2021년 8월 20일
I want to maximize the following function;
function y=wage3(x0,x1,x2) y(x) = -(x0*@logx0-x0)/3+(x1*@logx1-x1)/3-(x1*@logx1-x1)/6+(x2*@logx2-x2)/6+3*@logx0-(x1*@logx0)/3+(3*x0*@logx0)/6-(x2*@logx0)/6
This is a function that I want to optimize given the following constraint;
x0(1+h10+h20)+h11+h22*c2 =3*h11+6*h22
where h11=(c1-c0)/3 h10=1-(c1-c0)/3 h22=(c2-c0)/6 h20=1-(c2-c0)/6
x0,x1,x2 can only take on discrete values [1,2,3,4,5,6]. What I want to do is to fix x0 at one value (1,2,...6) and vary x1,x2 to find the combination yielding the highest y.
I have multiple problems;
1. I am told that "Undefined function 'mtimes' for input arguments of type 'function_handle'" when trying to run wage(1,2,2) (just random values). 2. I have no idea how to tell matlab to use the constraint I want. How do I save the constraint, how do I use it?
Very thankful for help!!

답변 (2개)

Nayan Rawat
Nayan Rawat 2019년 6월 18일
I also need help for a similar problem. por favor.

Nayan Rawat
Nayan Rawat 2019년 6월 18일
see Solving a Mixed Integer Engineering Design Problem Using the Genetic Algorithm in documentation. it might help.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by