Міністерство освіти і науки України
Національний технічний університет
«ХАРКІВСЬКИЙ ПОЛІТЕХНІЧНИЙ ІНСТИТУТ»
Курсова робота
з курсу «Інформатика» на тему:
MatLab
студента групи Е – 10
Моргуна Вадим а Викладач: Черкашина Галина
Харків 2011
Перша лабораторна робота
>>N=((exp(-11)+1)^(3/7)*sqrt((cos(11))^4+exp(-11)+1))/(((log(11))^2)*((cos(11))^4)^(5/3))
N =
0.3762
>>N=((exp(-11)+1)^(3/7)+sqrt((cos(11))^4+exp(-11)+1))/(((log(11))^2)+((cos(13))^4)^(5/3))
N =
0.3232
>>N=((exp(-11)+1)^(3/7)+sqrt((cos(11))^4+exp(-11)+1))/(((log(11))^2)+((cos(11))^4)^(5/3))
>> format long
N =
0.323191134097719
>>N=((exp(-11)+1)^(3/7)+sqrt((cos(11))^4+exp(-11)+1))/(((log(11))^2)+((cos(11))^4)^(5/3))
N =
0.3232
>> 5+5i
ans =
5.0000 + 5.0000i
>> 5+5i'
ans =
5.0000 - 5.0000i
>> (5+5i')^2
ans =
0 -50.0000i
>> (5+5i)*(5+5i')
ans =
50
>> Y=sin(5+5i)+cos(5-5i)
Y =
-50.1112 -50.1066i
Друга лабораторна робота
>> A=(tan(11))^2;
>> B=(log(11))^(-4);
>> C=1/exp(11);
>> D=B/C;
>> k=(A*(B+C)^(1/2))/(D^(1/5)/C)
k =
1.1623e-008
>> x=[0.2 0.3 0.5 0.8 1.3 1.7 2.5 13 k];
>> y=(sin(x)).^2./(1+cos(x))+exp(-x).*log(x)
y =
Columns 1 through 5
-1.2978 -0.8473 -0.2980 0.2030 0.8040
Columns 6 through 9
1.2258 1.8764 0.0926 -18.2702
>> v=[x y(5:9)]
v =
Columns 1 through 5
0.2000 0.3000 0.5000 0.8000 1.3000
Columns 6 through 10
1.7000 2.5000 13.0000 0.0000 0.8040
Columns 11 through 14
1.2258 1.8764 0.0926 -18.2702
>> v1=v+2.1
v1 =
Columns 1 through 5
2.3000 2.4000 2.6000 2.9000 3.4000
Columns 6 through 10
3.8000 4.6000 15.1000 2.1000 2.9040
Columns 11 through 14
3.3258 3.9764 2.1926 -16.1702
>> w=v+v1
w =
Columns 1 through 5
2.5000 2.7000 3.1000 3.7000 4.7000
Columns 6 through 10
5.5000 7.1000 28.1000 2.1000 3.7080
Columns 11 through 14
4.5516 5.8527 2.2851 -34.4405
>> w1=v-v1
w1 =
Columns 1 through 5
-2.1000 -2.1000 -2.1000 -2.1000 -2.1000
Columns 6 through 10
-2.1000 -2.1000 -2.1000 -2.1000 -2.1000
Columns 11 through 14
-2.1000 -2.1000 -2.1000 -2.1000
>> w2=v1-v
w2 =
Columns 1 through 5
2.1000 2.1000 2.1000 2.1000 2.1000
Columns 6 through 10
2.1000 2.1000 2.1000 2.1000 2.1000
Columns 11 through 14
2.1000 2.1000 2.1000 2.1000
>> w3=v./v1
w3 =
Columns 1 through 5
0.0870 0.1250 0.1923 0.2759 0.3824
Columns 6 through 10
0.4474 0.5435 0.8609 0.0000 0.2769
Columns 11 through 14
0.3686 0.4719 0.0422 1.1299
>> w4=v1.*v
w4 =
Columns 1 through 5
0.4600 0.7200 1.3000 2.3200 4.4200
Columns 6 through 10
6.4600 11.5000 196.3000 0.0000 2.3348
Columns 11 through 14
4.0767 7.4611 0.2029 295.4343
>> w5=v1.^v
w5 =
1.0e+015 *
Columns 1 through 2
0.0000 0.0000
Columns 3 through 4
0.0000 0.0000
Columns 5 through 6
0.0000 0.0000
Columns 7 through 8
0.0000 2.1218
Columns 9 through 10
0.0000 0.0000
Columns 11 through 12
0.0000 0.0000
Columns 13 through 14
0.0000 0.0000 - 0.0000i
>> sort(abs(v+v1))
ans =
Columns 1 through 5
2.1000 2.2851 2.5000 2.7000 3.1000
Columns 6 through 10
3.7000 3.7080 4.5516 4.7000 5.5000
Columns 11 through 14
5.8527 7.1000 28.1000 34.4405
>> sort(v+v1)
ans =
Columns 1 through 5
-34.4405 2.1000 2.2851 2.5000 2.7000
Columns 6 through 10
3.1000 3.7000 3.7080 4.5516 4.7000
Columns 11 through 14
5.5000 5.8527 7.1000 28.1000
>> -sort(-(v+v1))
ans =
Columns 1 through 5
28.1000 7.1000 5.8527 5.5000 4.7000
Columns 6 through 10
4.5516 3.7080 3.7000 3.1000 2.7000
Columns 11 through 14
2.5000 2.2851 2.1000 -34.4405
>> ind=[3 5];
>> ww=[w(ind) w1(ind) w2(ind) w3(ind) w4(ind) w5(ind)]
ww =
Columns 1 through 5
3.1000 4.7000 -2.1000 -2.1000 2.1000
Columns 6 through 10
2.1000 0.1923 0.3824 1.3000 4.4200
Columns 11 through 12
1.6125 4.9082
>> min(ww)
ans =
-2.1000
>> max(ww)
ans =
4.9082
>> sum(ww)
ans =
20.6153
>> prod(ww)
ans =
947.4858
>> ww(3:6)=1
ww =
Columns 1 through 5
3.1000 4.7000 1.0000 1.0000 1.0000
Columns 6 through 10
1.0000 0.1923 0.3824 1.3000 4.4200
Columns 11 through 12
1.6125 4.9082
>> who
Your variables are:
A C K Y ind v w w2 w4 ww y
B D N ans k v1 w1 w3 w5 x
>> whos
Name Size Bytes Class Attributes
A 1x1 8 double
B 1x1 8 double
C 1x1 8 double
D 1x1 8 double
K 1x1 8 double
N 1x1 8 double
Y 1x1 16 double complex
ans 1x1 8 double
ind 1x2 16 double
k 1x1 8 double
v 1x14 112 double
v1 1x14 112 double
w 1x14 112 double
w1 1x14 112 double
w2 1x14 112 double
w3 1x14 112 double
w4 1x14 112 double
w5 1x14 224 double complex
ww 1x12 96 double
x 1x9 72 double
y 1x9 72 double