Krzysztof Łowkis
AiR sem 5 gr1
Zadanie 1
>>A=[4 5 1 ; 2 -4 5]
A =
4 5 1
2 -4 5
>> B=[3 2 2; 7 6 9]
B =
3 2 2
7 6 9
>> C=[1 2 3; -2 4 5]
C =
1 2 3
-2 4 5
Dodawanie
>> A+B+C
ans =
8 9 6
7 6 19
Odejmowanie
>> A-B-C
ans =
0 1 -4
-3 -14 -9
Mnożenie
>> D=A.*B.*C
D =
12 20 6
-28 -96 225
Dzielenie
>> E=A./B./C
E =
1.3333 1.2500 0.1667
-0.1429 -0.1667 0.1111
Obliczanie w1 i w2
>> w1=(sqrt(A(1,1)))/C(2,3)^log(A(2,3))
w1 =
0.1500
>> w2=exp(C(2,1))/((sin(B(1,2)))*sqrt(2))
w2 =
0.1052
Zadanie 2
>> A=randn(100,10)
>>plot(A)
>>B=hist(A,10)
>> plot(B)
>> C=hist(A,20)
>> plot(C)
Zadanie 3
>> A=[5 -7 8 0; 2 0 4 0; 1 5 -3 0; -5 2 0 0]
A =
5 -7 8 0
2 0 4 0
1 5 -3 0
-5 2 0 0
>> B=[7 -7 8 0; -2 0 4 0; 21 5 -3 0 ; 0 2 0 0]
B =
7 -7 8 0
-2 0 4 0
21 5 -3 0
0 2 0 0
>> C=[5 7 8 0; 2 -2 4 0; 1 21 -3 0; -5 0 0 0]
C =
5 7 8 0
2 -2 4 0
1 21 -3 0
-5 0 0 0
>> D=[5 -7 7 0; 2 0 -2 0; 1 5 21 0; -5 2 0 0]
D =
5 -7 7 0
2 0 -2 0
1 5 21 0
-5 2 0 0
>> E=[5 -7 8 7; 2 0 4 -2; 1 5 -3 21; -5 2 0 0]
E =
5 -7 8 7
2 0 4 -2
1 5 -3 21
-5 2 0 0
>> det(A)
ans =
0
>> det(B)
ans =
0
>> det(C)
ans =
0
>> det(D)
ans =
0
>> det(E)
ans =
-3894