matlab 画出阴影图2.114k1-1.2103k2>=1.2156;2.114k1-1.2103k2=0k2>=0用阴影画出k1,k2组成的区域
来源:学生作业帮助网 编辑:作业帮 时间:2024/12/01 13:50:55
matlab 画出阴影图2.114k1-1.2103k2>=1.2156;2.114k1-1.2103k2=0k2>=0用阴影画出k1,k2组成的区域
matlab 画出阴影图
2.114k1-1.2103k2>=1.2156;
2.114k1-1.2103k2<=0.2192;
0.5907k1-0.3381k2<=-0.0045;
0.5907k1-0.3381k2>=-0.0431;
1.7118k1-0.9799k2<=0.0219;
1.7118k1-0.9799k2>=-0.0159;
k1>=0
k2>=0
用阴影画出k1,k2组成的区域
matlab 画出阴影图2.114k1-1.2103k2>=1.2156;2.114k1-1.2103k2=0k2>=0用阴影画出k1,k2组成的区域
clc;clear
%{
2.114k1-1.2103k2>=1.2156;
2.114k1-1.2103k2<=0.2192;
0.5907k1-0.3381k2<=-0.0045;
0.5907k1-0.3381k2>=-0.0431;
1.7118k1-0.9799k2<=0.0219;
1.7118k1-0.9799k2>=-0.0159;
k1>=0
k2>=0
用阴影画出k1,k2组成的区域
%}
syms k2
k1=0:1;
f1=2.114*k1-1.2103*k2-1.2156;
f2=2.114*k1-1.2103*k2-0.2192;
f3=0.5907*k1-0.3381*k2+0.0045;
f4=0.5907*k1-0.3381*k2+0.0431;
f5=1.7118*k1-0.9799*k2-0.0219;
f6=1.7118*k1-0.9799*k2+0.0159;
for m=1:length(k1);
k21(m)=solve(f1(m))
k22(m)=solve(f2(m))
k23(m)=solve(f3(m))
k24(m)=solve(f4(m))
k25(m)=solve(f5(m))
k26(m)=solve(f6(m))
end
plot(k1,[eval(k21);eval(k22);eval(k23);eval(k24);eval(k25);eval(k26)])
axis([0 1 0 1])
legend('2.114k1-1.2103k2>=1.2156','2.114k1-1.2103k2<=0.2192')
a1=2.114/1.2103
a2=0.5907/0.3381
a3=1.7118/0.9799