Rustam Usmanov



Download 0,56 Mb.
Pdf ko'rish
bet2/4
Sana10.06.2022
Hajmi0,56 Mb.
#650203
1   2   3   4
Bog'liq
Rustam Usmanov (1)

Experiment No: 1
Write a program to assign the following expressions to a variable A and then to print out
the value of A.
Code:
clc;
clear all;
% program for 1.a
a=3+4;
b=5+6;
z=a/b
% program for 1.b
% value of 2*pi*pi
disp('value of 2*pi*pi is=')
w=2*pi*pi
% program for 1.c
% value of square root 2
disp('value of square root 2=')
q=sqrt(2)
% program for 1.d
A=0.0000123;
B=5.67;
C=10^-3;
D=0.4567;
E=10^-4;
Z=(A+B*C)*D*E
Output:
z = 0.6364
value of 2*pi*pi is=
w = 19.739
value of square root 2=
q = 1.4142


Z = 2.5951e-07
Experiment No: 2
Celsius temperatures can be converted to Fahrenheit by multiplying by 9, dividing by 5,
and adding 32. Assign a variable called C the value 37, and implement this formula to
assign a variable F the Fahrenheit equivalent of 37 Celsius.
Code:
T=input('Enter the temperature in degree celcius=')
c2=T;
f2=((c2*9)/5)+32;
disp('The temperature in Farhenite=')
disp(f2)
Output:
octave:1>
source("my_script.m")
Enter the temperature in degree celcius=
>
23
T = 23
The temperature in Farhenite=
73.400


Experiment No: 3
Set up a vector called N with five elements having the values: 1, 2, 3, 4, 5. Using N,
create assignment statements for a vector X which will result in X having these values:
Code:
clc;
N=[1 2 3 4 5];
X=2*N;
disp(X);
X=N/2;
disp(X);
X=N.^-1;
disp(X);
X=N.^-2;
disp(X);
Output:
2 4 6 8 10 0.5000 1.0000 1.5000 2.0000 2.5000 1.0000 0.5000
0.3333 0.2500 0.2000 1.000000 0.250000 0.111111 0.062500
0.040000



Download 0,56 Mb.

Do'stlaringiz bilan baham:
1   2   3   4




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish