109
Matritsalar ustida amallar
11.
RESHAPE - matrisa o’lchamini o’zgartiring : A=[-1 0 3 0; 0 1 2 -1; -4 -2 -3 2];
12. Berilgan matritsaning diagonaildan yuqori qismini elementlarini 0 bilan
almashtiring:
A=[-1 2 4 0 3; -2 1 0 3 4; -2 -1 0 -2 1; -2 3 -1 -1 1; 1 1 1 -1 -1];
13. Berilgan matritsaning diagonaildan pastkii qismini elementlarini 0 bilan
almashtirish:
A=[-6 2 4 4 3; -2 1 0 3 4; -2 -1 0 -2 1; -2 3 -1 -1 1; 1 8 1 -1 -1]
14. Berilgan matritsaning diagonaildan elementlarini 0 bilan almashtirish:
A=[-2 2 4 0 3; -2 1 0 3 4; -2 -1 0 -2 1; -2 3 -1 -1 1; 1 5 1 -1 -1]
15. diag(A) buyrug’i berilgan matritsaning diagonalida tugan elementlarni ekranga
chiqaring:
A=[-1 0 1; 0 -1 0; 1 -1 1]
16. diag(A) buyrug’i berilgan matritsaning diagonalida tugan elementlarni ekranga
chiqaring:
A=[-3 5 1; 0 -1 0; 1 -6 1]
17. diag(A) buyrug’i berilgan matritsaning diagonalida tugan elementlarni ekranga
chiqaring:
A=[-1 5 1; 0 -8 0; 1 -1 1]
18. Berilgan matritsani soat strelkasiga qarshi 90
0
ga
burish uchun ishlatiladigan
rot90(A) buyrug’i:
A=[-1 0 1; 0 -1 0; 1 -1 1]
19. Berilgan matritsani soat strelkasiga qarshi 45
0
ga burish uchun ishlatiladigan
rot45(A) buyrug’i:
A=[-1 0 1; 0 -1 0; 1 -1 1]
20. Berilgan matritsani soat strelkasiga qarshi 180
0
ga burish uchun ishlatiladigan
rot180(A) buyrug’i:
A=[-1 0 1; 0 -1 0; 1 -1 1]
21. Matritsalarni yuqoridan
pastga burishda flipud buyrug’idan foydalanish:
A=[-1 0 1; 0 -1 0; 1 -1 1]
22. Matritsalarni chapdan o’ngga burishda fliplr buyrug’idan foydalanish:
A=[-1 0 1; 0 -1 0; 1 -1 1]
23. Matritsalarni o`ngdan chapga burishda fliplr buyrug’idan foydalanish:
A=[-1 0 1; 0 -1 0; 1 -1 1]
24. Matritsalarni chapdan o’ngga burishda fliplr buyrug’idan foydalanish:
A=[-7 0 1; 0 -4 0; 1 -1 3]
25. Matritsalarni chapdan o’ngga burishda fliplr buyrug’idan foydalanish:
A=[-3 0 3; 0 -7 0; 1 -2 1]
26. A va B matritsalarni bir-biriga qo’shish
A=[-1 0 1; 0 -1 0; 1 -1 1];
B=[1 1 0; 2 -1 0; 3 8 1];
27. A va B matritsalarni bir-biriga qo’shish
A=[-1 7 1; 0 -5 0; 1 2 1];
110
B=[4 1 7; 2 -5 0; 3 0 1];
28. A va B matritsalarni bir-biriga ko`paytirish.
A=[-1 7 1; 0 -5 0; 1 2 1];
B=[4 1 7; 2 -5 0; 3 0 1];
29. A va B matritsalarni bir-biriga bo`lish.
A=[-1 7 1; 0 -5 0; 1 2 1];
B=[4 1 7; 2 -5 0; 3 0 1];
30. MATLABda for-loops va boshqa operatorlardan foydalanib
nxn o’lchamdagi
ixtiёriy A matrisaning ustunlarining yig’indisini hisoblovchi ustun_hisobi deb
nomlangan m-faylni (m-file) yarating.