Задача б
>> a=2.2; b=24.8; X(1)=0.6; X(2)=1.2; X(3)=1.6; X(4)=0.83; X(5)=0.94; X(6)=1.05; X(7)=1.3; X(8)=0.75;
>> for m=1:6 y(m)=(exp(a.*x(m))+log(b.*x(m)).^2)./(sqrt(1+exp(a.*x(m)))), end; [x;y]
y =
Columns 1 through 8
5.0660 5.2325 5.3826 5.5198 5.6469 5.7668 5.8818 5.9943
Columns 9 through 13
6.1065 6.2202 6.3372 6.4593 6.5881
y =
Columns 1 through 8
5.0660 5.2325 5.3826 5.5198 5.6469 5.7668 5.8818 5.9943
Columns 9 through 13
6.1065 6.2202 6.3372 6.4593 6.5881
y =
Columns 1 through 8
5.0660 5.2325 5.3826 5.5198 5.6469 5.7668 5.8818 5.9943
Columns 9 through 13
6.1065 6.2202 6.3372 6.4593 6.5881
y =
Columns 1 through 8
5.0660 5.2325 5.3826 5.5198 5.6469 5.7668 5.8818 5.9943
Columns 9 through 13
6.1065 6.2202 6.3372 6.4593 6.5881
y =
Columns 1 through 8
5.0660 5.2325 5.3826 5.5198 5.6469 5.7668 5.8818 5.9943
Columns 9 through 13
6.1065 6.2202 6.3372 6.4593 6.5881
y =
Columns 1 through 8
5.0660 5.2325 5.3826 5.5198 5.6469 5.7668 5.8818 5.9943
Columns 9 through 13
6.1065 6.2202 6.3372 6.4593 6.5881
ans =
Columns 1 through 8
0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500
5.0660 5.2325 5.3826 5.5198 5.6469 5.7668 5.8818 5.9943
Columns 9 through 13
1.0000 1.0500 1.1000 1.1500 1.2000
6.1065 6.2202 6.3372 6.4593 6.5881
Варіант 4
Завдання 1. Обчислення арифметичних виразів
>> x=3.981; y=-1.625;
>> b=(2.^(-x).*sqrt(x+sqrt(abs(y)).^(1./4)))./(atan(x.^2)-y)
b =
0.0454
Завдання 2. Розгалужений обчислювальний процес
>> x=0.25; y=1.42; z=0.54;
>> if x>=z
A=(sqrt(y.*log(x))-z.*x.^2)./(1+tan(x).^3)
else B=(2.*sqrt(y.*(x+2.^2)).^(1./5))./(x.*sin(y).^2)
end
B =
9.7965
>> x=0.86;
>> if x>=z
A=(sqrt(y.*log(x))-z.*x.^2)./(1+tan(x).^3)
else B=(2.*sqrt(y.*(x+2.^2)).^(1./5))./(x.*sin(y).^2)
end
A =
-0.1556 + 0.1803i
Завдання 3. Арифметичні цикли. Задача а
>> a=1.45; b=6.4; x=7.0:4.0:35.0; y=(sqrt(a.*x+b).^(1./3))./(log(a.*x).^2); [x;y]
ans =
Columns 1 through 3
7.0000 11.0000 15.0000
0.2972 0.2188 0.1839
Columns 4 through 6
19.0000 23.0000 27.0000
0.1636 0.1502 0.1405
Columns 7 through 8
31.0000 35.0000
0.1331 0.1273
Задача б
>> a=1.45; b=6.4; X(1)=7.0; X(2)=35.0; X(3)=24.2; X(4)=16.8; X(5)=18.5; X(6)=19.3; X(7)=14.9;
>> for m=1:6 y(m)=(sqrt(a.*x(m)+b).^(1./3))./(log(a.*x(m)).^2), end; [x;y]
y =
Columns 1 through 3
0.2972 0.2188 0.1839
Columns 4 through 6
0.1636 0.1502 0.1405
Columns 7 through 8
0.1331 0.1273
y =
Columns 1 through 3
0.2972 0.2188 0.1839
Columns 4 through 6
0.1636 0.1502 0.1405
Columns 7 through 8
0.1331 0.1273
y =
Columns 1 through 3
0.2972 0.2188 0.1839
Columns 4 through 6
0.1636 0.1502 0.1405
Columns 7 through 8
0.1331 0.1273
y =
Columns 1 through 3
0.2972 0.2188 0.1839
Columns 4 through 6
0.1636 0.1502 0.1405
Columns 7 through 8
0.1331 0.1273
y =
Columns 1 through 3
0.2972 0.2188 0.1839
Columns 4 through 6
0.1636 0.1502 0.1405
Columns 7 through 8
0.1331 0.1273
y =
Columns 1 through 3
0.2972 0.2188 0.1839
Columns 4 through 6
0.1636 0.1502 0.1405
Columns 7 through 8
0.1331 0.1273
ans =
Columns 1 through 3
7.0000 11.0000 15.0000
0.2972 0.2188 0.1839
Columns 4 through 6
19.0000 23.0000 27.0000
0.1636 0.1502 0.1405
Columns 7 through 8
31.0000 35.0000
0.1331 0.1273
Варіант 5
Завдання 1. Обчислення арифметичних виразів
>> x=3.981; z=0.512;
>> b=(sqrt(exp(x-1./sin(x))).^(1./3))./(sqrt(x)+1)+(exp(x+z))
b =
90.2001
Завдання 2. Розгалужений обчислювальний процес
>> x=1.2; y=0.54; z=-1.86;
>> if x>=y
A=z.*sinh(x)+sqrt(x).^(1./3)
else B=(sqrt(abs(z).*exp(-(y+(x./3)))))./(x.^2.*y)
end
A =
-1.7767
>> x=0.22;
>> if x>=y
A=z.*sinh(x)+sqrt(x).^(1./3)
else B=(sqrt(abs(z).*exp(-(y+(x./3)))))./(x.^2.*y)
end
B =
38.4002
Завдання 3. Арифметичні цикли
Задача А
>> a=0.24; b=2.5; x=1.2:0.4:5.0; y=(a+sin(b.^2+x.^2).^2)./(sqrt(b.^2+x.^2).^(1./3)); [x;y]
ans =
Columns 1 through 3
1.2000 1.6000 2.0000
0.8636 0.3985 0.5291
Columns 4 through 6
2.4000 2.8000 3.2000
0.3429 0.7964 0.4617
Columns 7 through 9
3.6000 4.0000 4.4000
0.2227 0.1822 0.2627
Column 10
4.8000
0.5480
