用matlab解题急
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/18 09:43:44
用matlab解题急
第一题:
function [res] = fun(x)
if x = 10,res = x*sqrt(x+sqrt(x));
else res = cos(x+1) + sqrt(x*x+1);end
end
第二题:
clear
clc
x = 1200:400:4000;
y = 1200:400:3600;
[xx,yy] = meshgrid(x,y);
z = [
1480 1500 1550 1510 1430 1300 1200 980;
1500 1550 1600 1550 1600 1600 1600 1550;
1500 1200 1100 1550 1600 1550 1380 1070;
1500 1200 1100 1350 1450 1200 1150 1010;
1390 1500 1500 1400 900 1100 1060 950;
1320 1450 1420 1400 1300 700 900 850;
1130 1250 1280 1230 1040 900 500 700
];
contour(xx,yy,z);%两种图,一个等高线,另一个表面形式
%surf(xx,yy,z);
function [res] = fun(x)
if x = 10,res = x*sqrt(x+sqrt(x));
else res = cos(x+1) + sqrt(x*x+1);end
end
第二题:
clear
clc
x = 1200:400:4000;
y = 1200:400:3600;
[xx,yy] = meshgrid(x,y);
z = [
1480 1500 1550 1510 1430 1300 1200 980;
1500 1550 1600 1550 1600 1600 1600 1550;
1500 1200 1100 1550 1600 1550 1380 1070;
1500 1200 1100 1350 1450 1200 1150 1010;
1390 1500 1500 1400 900 1100 1060 950;
1320 1450 1420 1400 1300 700 900 850;
1130 1250 1280 1230 1040 900 500 700
];
contour(xx,yy,z);%两种图,一个等高线,另一个表面形式
%surf(xx,yy,z);