Ishni bajarish tartibi:
1. Buyruqlar satriga o’ting.
ning qiymatini hisoblash uchun buyruqlar satriga
>> sqrt(4+sqrt(9)) ni kiriting. Enter tugmachasini bosib natijani chiqarish mumkin:
ans =
2.6458
2. ni hisoblang.
>>(sqrt(25)-4)/sqrt(3)
3. ni hisoblang.
>> sin(pi/3)-cos(pi/3)*atan(1)ni kiritib, natijani chiqaring.
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
Quyidagi jadlvalda asosiy standart funksiyalar va ularning MATLABdagi yozilish qoidalari keltirilgan.
Do'stlaringiz bilan baham: |