4 курс_1 / Мат.мод 313 / laba2 Захар
.docxШаг 1
x=3:0.1:8;
>> y1=log((x.^2)-1)-sin(x).*((x.^2)-1);
>> plot(x,y1)
>> title('Grafik funkcii y1=log((x.^2)-1)-sin(x).*((x.^2)-1)')
Шаг 2
>> y2=log((x.^2)-1)+cos(x).*((x.^2)-1);
>> plot(x,y1,x,y2,'k');grid
Шаг3
>> a=[1 4 8];
>> a'*ones(1,3)
ans =
1 1 1
4 4 4
8 8 8
>> x=1:0.5:2
x =
1.0000 1.5000 2.0000
>> ones(3,1)*x
ans =
1.0000 1.5000 2.0000
1.0000 1.5000 2.0000
1.0000 1.5000 2.0000
>>y=((ones(3,1)*x).^3)-(((a'*ones(1,3)).^2)*((ones(3,1)*x).^2));
plot(x,y);grid
шаг 4
>> t=0:pi/100:2*pi;
>> plot(sin(t),cos(3*t));grid
Шаг 5
>> x1=3:0.1:8;
>> y1=log((x.^2)-1)-sin(x).*((x.^2)-1);
>> y2=log((x.^2)-1)+cos(x).*((x.^2)-1);
>> subplot(2,2,1);plot(x1,y1)
>> subplot(2,3,5);plot(x1,y1,x1,y2,'k');grid
Шаг 6
>> [x,y]=meshgrid(-8:0.1:6,-4:0.1:4);
>> z=x.^2+2.8.*y.^2+2.*x-y+0.1;
>> surf(x,y,z)
>> title('Grafik funkcii z=x.^2+2.8.*y.^2+2.*x-y+0.1')
>> colorbar
Шаг 7
>> x=1:0.1:10;
>> y=log((x.^2)-1)-sin(x).*((x.^2)-1);
>> plot(x,y);grid
Шаг 8 m функция
fun1(1:0.1:10)
ans =
Columns 1 through 12
-Inf -1.7478 -1.2311 -1.0359 -0.9869 -1.0237 -1.1146 -1.2377 -1.3749 -1.5105 -1.6293 -1.7168
Columns 13 through 24
-1.7592 -1.7428 -1.6550 -1.4838 -1.2184 -0.8493 -0.3685 0.2300 0.9505 1.7949 2.7629 3.8516
Columns 25 through 36
5.0556 6.3667 7.7741 9.2644 10.8216 12.4271 14.0601 15.6976 17.3148 18.8854 20.3816 21.7750
Columns 37 through 48
23.0365 24.1372 25.0483 25.7422 26.1922 26.3739 26.2648 25.8453 25.0990 24.0129 22.5784 20.7908
Columns 49 through 60
18.6502 16.1615 13.3349 10.1854 6.7336 3.0051 -0.9694 -5.1540 -9.5083 -13.9872 -18.5417 -23.1193
Columns 61 through 72
-27.6642 -32.1182 -36.4214 -40.5125 -44.3300 -47.8126 -50.9003 -53.5349 -55.6612 -57.2274 -58.1864 -58.4962
Columns 73 through 84
-58.1207 -57.0306 -55.2037 -52.6260 -49.2917 -45.2038 -40.3746 -34.8254 -28.5875 -21.7010 -14.2160 -6.1912
Columns 85 through 91
2.3057 11.1987 20.4042 29.8318 39.3845 48.9604 58.4532
>>
