Calculus Matlab two variables
조회 수: 2 (최근 30일)
이전 댓글 표시
% code
clear all
a) -------------------------
r1 = linspace (1,4);
r2 = linspace (1,10);
c1 = 4 + r1 + r1.^2
c2 = 25./(1+(exp(1)).^(-r2+6))
ctot = c1 + c2
plot (ctot)
b) -------------------------
r1 = linspace (1,4);
r2 = linspace (1,10);
c1 = 4 + r1 + r1.^2
c2 = 25./(1+(exp(1)).^(-r2+6))
ctot = c1 + c2
plot3(c1,c2,ctot)
hold on
z = 8.*r1+3.*r2-24
r_1 = 8.*r1
r_2 = 3.*r2
z = linspace (24,24);
plot3 (r_1,r_2,z)
end
This is how far ive come. I know this problem should be really simple to solve, but i struggle. I have no clue about c,d,e part questions.
답변 (1개)
xi
2017년 4월 25일
Try this, using fmincon(), to solve the min problem
x0=[1,1]; Aeq=[8,3]; beq=24; lb=[1,1]; ub=[4,10];
fun=@(x)4+x(1)+x(2)^2+25/(1+exp(-x(2)+6)); [x val] = fmincon(fun,x0,[],[],Aeq,beq,lb,ub);
참고 항목
카테고리
Help Center 및 File Exchange에서 Linear Programming and Mixed-Integer Linear Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!