O‘ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI MUHAMMAD AL-XORAZMIY NOMIDAGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI
“KOMPYUTER TIZIMLARI” kafedrasi
LABARATORIYA ISHI
211-19 guruh talabasi Xushvaqov Azizbek
Toshkent – 2022
1-Laboratoriya mashg’uloti. Matlab tizimida interpolyatsiya va approksimatsiya masalalarini yechish.
Ishdan maqsad: Matlab tizimida arifmetik ifodalar qiymatlarini hisoblash, o’zlashtirish operatorlaridan foydalanish, kompleks sonlar bilan ishlash ko’nikmalarini hosil qilish.
Nazariy ma’lumot:
n – tartibli ko’phad quyidagicha ifodalanadi:
(1)
n –ko’phad tartibi, .
Аgar bo’lsa, ya’ni u holda funksiya rasional funksiya deyiladi. Ikki ko‘phadning nisbati natijasida kasr-rasional funksiya hosil bo‘ladi.
Matlabdа (1) ko‘phad koeffisientlari darajalari kamayib borish tartibida joylashtirilgan vektor ko‘rinishida ifodalanadi. Masalan: ko’phadni Matlabdа berilishi:
Ikki m – vа n – tartibli ko’phadlarni ko’paytirish operatsiyasi konvolyutsiya deyiladi va quyidagicha kiritiliadi: с=conv(a,b), bu yerdа a,b – uzunliklari (m+1) va (n+1) bo‘lgan va ko‘paytirilayotgan ko‘phadlar koeffisientlaridan iborat vektorlar.
Variant nomer : 15
>> x = linspace(0.1,1,30)
x =
Columns 1 through 11
0.1000 0.1310 0.1621 0.1931 0.2241 0.2552 0.2862 0.3172 0.3483 0.3793 0.4103
Columns 12 through 22
0.4414 0.4724 0.5034 0.5345 0.5655 0.5966 0.6276 0.6586 0.6897 0.7207 0.7517
Columns 23 through 30
0.7828 0.8138 0.8448 0.8759 0.9069 0.9379 0.9690 1.0000
>> y = ((1 + x.^2)/2).* atan(x) - x/2
y =
Columns 1 through 11
0.0003 0.0007 0.0014 0.0024 0.0037 0.0055 0.0077 0.0104 0.0138 0.0177 0.0223
Columns 12 through 22
0.0276 0.0337 0.0406 0.0483 0.0569 0.0664 0.0768 0.0882 0.1006 0.1141 0.1286
Columns 23 through 30
0.1442 0.1608 0.1787 0.1976 0.2178 0.2391 0.2616 0.2854
1-rasm. Matlab dasturidagi kiritilishi
2-rasm. Grafigining ko’rinishi
Номер
варианта
|
15
|
x
|
y
|
1.2
|
0.079
|
1.3
|
0.114
|
1.4
|
0.146
|
1.6
|
0.204
|
1.7
|
0.230
|
1.9
|
0.278
|
2.1
|
0.222
|
2.2
|
0.142
|
2.4
|
0.180
|
2.6
|
0.241
|
2.7
|
0.331
|
x = [1.2 1.3 1.4 1.6 1.7 1.9 2.1 2.2 2.4 2.6 2.7]
x =
Columns 1 through 5
1.2000 1.3000 1.4000 1.6000 1.7000
Columns 6 through 10
1.9000 2.1000 2.2000 2.4000 2.6000
Column 11
2.7000
>> xi = [0.079 0.114 0.146 0.204 0.230 0.278 0.222 0.142 0.180 0.241 0.311]
xi =
Columns 1 through 5
0.0790 0.1140 0.1460 0.2040 0.2300
Columns 6 through 10
0.2780 0.2220 0.1420 0.1800 0.2410
Column 11
0.3110
>> y = ((1 + x.^2)/2).* atan(x) - x/2
y =
Columns 1 through 5
0.4688 0.5808 0.7068 1.0017 1.1710
Columns 6 through 10
1.5540 1.9969 2.2410 2.7749 3.3701
Column 11
3.6907
>> fi2=interp1(x,y,xi,'spline');
plot(x,z,'-o',y,fi1,':*'), grid, hold on
legend (' = ((1 + x.^2)/2).* atan(x) - x/2','spline')
>>
Dostları ilə paylaş: |