Calculus Matlab two variables
1 回表示 (過去 30 日間)
古いコメントを表示
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/163355/image.jpeg)
% 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 で Calculus についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!