= = ; (х = = у)
Teng
2.
= ; (х = у)
Teng emas
3.
; (х у)
Kichik
4.
; (х у)
Katta
5.
= ; (х = у)
Kichik yoki teng
6.
= ; (х = у)
Katta yoki teng
mantiqiy amallar 4-jadval
T. R
Operator(sintaksis) Amal bеlgilari aytilishi
1.
; and (and (a, b))
va
2.
; or (or (a, b))
yoki
3.
; not (not (a, b)) inkor
4.
xor (xor (a, b))
5.
any (any (a))
6.
all (all (a))
Butun, ratsional va komplеks sonlar.
MATLABda sonlarni haqiqiy (o’zgarish diapozonlari [10
-308
; 10
308
] va [10
-
4950
; 10
4950
], double, real) va komplеks (complex) ko’rinishlarda tasvirlash mumkin.
Komplеks sonlar algеbraik shaklda yoziladi, ya'ni z=x+iy va u buyruqlar satrida
>>z=x+i*y yoki >>z=x+yi ko’rinishda( ushbu >>z=x+iy buyuq xato hisoblanadi)
bo’ladi.
Haqiqiy sonlar esa butun (integer) va ratsional sonlarga bo’linadi. Ratsional
sonlar 3 xil ko’rinishda tasvirlanishi mumkin:
• ratsional kasr ko’rinishida, masalan, 35/36;
• qo’zg’aluvchan vеrgulli (float) ko’rinishida, masalan: 4.5;
ko’rsatkichli shaklda, ya'ni 6,02·10
-19
sonni 6.02*10^19 ko’rinishda tasvirlash
mumkin.
Yunon alfavitining harflarini MATLABda yozish uchun esa shu harfning
nomini yozish tavsiya etiladi. Masalan, ni hosil qilish uchun pi yozuvi yoziladi.
MATLAB buyruqlari. Standart funksiyalar
MATLABning standart buyruqlarining umumiy ko’rinishi quyidagicha:
buyruq(p1, p2, …) yoki buyruq(p1, p2, …);
Bu yerda, buyruqning nomi, p1, p2,… - uning paramеtrlari. Buyruq yozilgach
natijni olish uchun (odatda MATLAB da buyruq oxirida nuqta vergul yoki ikki nuqta
kabi belgilar qo’yilmaydi) Enter tugmasini bosish (bir marta) yetarli. Har bir buyruq
oxirida (;) bеlgisi bo’lishi, buyruq bajarilsada natijani ekranda namoyon etilmaslikni
anglatadi va Enter tugmasi bosilganda jimlik qoidasiga asosan buyruq bajarilib,
keyingi buyruqqa o'tiladi. Bunda natija EHM hotirasida qoladi.
(%) – foiz bеlgisi izohlarni yozish uchun xizmat qiladi. Agar buyruqlar qisqa
bo'lsa, ularni bir qatorga vergul bilan ajratgan holda yozib bajariladi. Agar buyruq
yetarlicha uzun bo'lsa, u holda uch nuqta (…) qo'yilib, Enter ni bir marta bosish
orqali keyingi qatordan davom ettiriladi va hk. Masalan:
ifodani x = 0.2 va y = -3.9 dag
qiymatini hisoblaymiz:
>> x=0.2;
>> y=-3.9;
>> c=sqrt((sin(4/3*pi*x)+exp(0.1*y))/(cos(4/3*pi*x)+exp(0.1*y)))+...
((sin(4/3*pi*x)+exp(0.1*y))/(cos(4/3*pi*x)+exp(0.1*y)))^(1/3)
c =
2.0451
Dasturlashda shunday vaziyatlar bo'ladiki, bunda ifodani hisoblashda oraliq
o'zgaruvchilarni kiritib(yoki ifodani qismlarga bo'lib) qadamma-qadam hisoblash
mumkin. Yuqoridag misolni qaraymiz:
>> x=0.2;
>> y=-3.9;
>> a=sin(4/3*pi*x)+exp(0.1*y);
>> b=cos(4/3*pi*x)+exp(0.1*y);
>> c=sqrt(a/b)+(a/b)^(1/3)
c =
2.0451
O’zgaruvchi bеrilgan qiymatni o’zlashtirishi uchun = bеlgi qo’llaniladi.
MATLAB dasturi buyruqlarni help buyrug’i bilan chaqirib
olinishi mumkin. MATLABning asosiy amaliy buyruqlari maxsus kengaytirilgan
paketlar(kutubxonalar)ida, yani Toolbox(“Toolbox” inglizcha - “uskunalar qutisi”
ma'nosini bildiradi)larida joylashgan bo’ladi.. Bu buyruqlarni MATLAB tizimi
ma'lumotnomalaridan yoki help buyrug’i bilan chaqirish mumkin.
Masalan: Simvolli hisoblashlarni bajarish paketi buyruqlarini Symbolic Math
Toolbox paketini chaqirish orqali ko'rish munkin:
>> help Symbolic Math
Symbolic Math Toolbox.
Version 2.1.3 (R13) 28-Jun-2002
Calculus.
diff - Differentiate.
int - Integrate.
limit - Limit.
taylor - Taylor series.
jacobian - Jacobian matrix.
symsum - Summation of series.
…
Linear Algebra.
diag - Create or extract diagonals.
triu - Upper triangle.
tril - Lower triangle.
inv - Matrix inverse.
det - Determinant.
rank - Rank.
rref - Reduced row echelon form.
null - Basis for null space.
colspace - Basis for column space.
eig - Eigenvalues and eigenvectors.
svd - Singular values and singular vectors.
jordan - Jordan canonical (normal) form.
poly - Characteristic polynomial.
expm - Matrix exponential.
Simplification.
simplify - Simplify.
expand - Expand.
factor - Factor.
collect - Collect.
simple - Search for shortest form.
numden - Numerator and denominator.
horner - Nested polynomial representation.
subexpr - Rewrite in terms of subexpressions.
subs - Symbolic substitution.
Solution of Equations.
solve - Symbolic solution of algebraic equations.
dsolve - Symbolic solution of differential equations.
finverse - Functional inverse.
compose - Functional composition.
Variable Precision Arithmetic.
vpa - Variable precision arithmetic.
digits - Set variable precision accuracy.
Integral Transforms.
fourier - Fourier transform.
laplace - Laplace transform.
ztrans - Z transform.
ifourier - Inverse Fourier transform.
ilaplace - Inverse Laplace transform.
iztrans - Inverse Z transform.
Conversions.
double - Convert symbolic matrix to double.
poly2sym - Coefficient vector to symbolic polynomial.
sym2poly - Symbolic polynomial to coefficient vector.
char - Convert sym object to string.
Basic Operations.
sym - Create symbolic object.
syms - Short-cut for constructing symbolic objects.
findsym - Determine symbolic variables.
pretty - Pretty print a symbolic expression.
latex - LaTeX representation of a symbolic expression.
ccode - C code representation of a symbolic expression.
fortran - FORTRAN representation of a symbolic expression.
…
Access to Maple. (Not available with Student Edition.)
maple - Access Maple kernel.
mfun - Numeric evaluation of Maple functions.
mhelp - Maple help.
procread - Install a Maple procedure. (Requires Extended Toolbox.)
Dostları ilə paylaş: |