Vous êtes sur la page 1sur 2

12/29/17 12:35 AM F:\Books & Documents\Pdf Bo...\a1_prac.

m 1 of 2

% 1.9 EXAMPLES OF MATLAB APPLICATIONS


% MATLAB An Introduction with Applications by Amos Gilat 4th ed.

%% Sample Problem 1-1: Trigonometric identity


x=pi/5;
a=cos(x/2)^2
b=(tan(x)+sin(x))/(2*tan(x))
c=cosd(x/2)^2
d=(tand(x)+sind(x))/(2*tand(x))

%% Sample Problem 1-2: Geometry and trigonometry


R1=16; R2=6.5; R3=12; R4=9.5;
C1C2=R1+R2; C1C3=R1+R3; C1C4=R1+R4;
C2C3=R2+R3; C3C4=R3+R4;
Gama1=acos((C1C2^2+C1C3^2-C2C3^2)/(2*C1C2*C1C3));
Gama2=acos((C1C3^2+C1C4^2-C3C4^2)/(2*C1C3*C1C4));
Gama3=Gama1+Gama2;
C2C4=sqrt(C1C2^2+C1C4^2-2*C1C2*C1C4*cos(Gama3))

%% Sample Problem 1-3: Heat transfer


T0=120; Ts=38; k=0.45; t=3;
T1=Ts+(T0-Ts)*exp(-k*t)
T_a=round(T1)
% or
T_b=round(Ts+(T0-Ts)*exp(-k*t))

%% 1.10.1a Problems
a1=(14.8^2+6.5^2)/(3.8^2)+55/(sqrt(2)+14)

%% 1.10.1b Problems
b1=(-3.5)^3+exp(6)/log(524)+nthroot(206,3)

%% 1.10.2a Problems
a2=(16.5^2*(8.4-sqrt(70)))/(4.3^2-17.3)

%% 1.10.2b Problems
b2=(5.2^3-6.4^2+3)/(1.6^8-2)+(13.3/5)^1.5

%% 1.10.3a Problems
a3=15*((sqrt(10)+3.7^2)/(log10(1365)+1.9))

%% 1.10.3b Problems
b3=((2.5^3*(16-216/22))/(1.7^4+14))+nthroot(2050,4)

%% 1.10.4a Problems
a4=(2.3^2*1.7)/sqrt((1-0.8^2)^2+(2-sqrt(0.87))^2)

%% 1.10.4b Problems
b4=2.34+(1/2)*2.7*(5.9^2-2.4^2)+9.8*log(51)

%% 1.10.5a Problems
12/29/17 12:35 AM F:\Books & Documents\Pdf Bo...\a1_prac.m 2 of 2

a5=sin(7*pi/9)/cos((5/7)*pi)^2+(1/7)*tan((5/12)*pi)

%% 1.10.5b Problems
b5=tand(64)/cosd(14)^2-(3^sind(80)/nthroot(0.9,3))+cosd(55)/sind(11)

%% 1.10.6 Problems
x=2.34;
a6=2*x^4-6*x^3+14.8*x^2+9.1
b6=exp(2*x)/sqrt(14+x^2-x)

%% 1.10.7 Problems
t=6.8;
a7=log(abs(t^2-t^3))
b7=(75/(2*t))*cos(0.8*t-3)

%% 1.10.8 Problems
x=8.3; y=2.4;
a8=x^2+y^2-(x^2/y^2)
b8=sqrt(x*y)-sqrt(x+y)+((x-y)/(x-2*y))^2-sqrt(x/y)

%% 1.10.9 Problems
a=12; b=4.2; c=(4*b)/a, d=(a*b*c)/(a+b+c)
a9=a*(b/(c+d))+(d/c)*(a/b)-(a-b^2)*(c+d)
b9=sqrt(a^2+b^2)/(d-c)+log(abs(b-a+c-d))

%% 1.10.10 Problems

Vous aimerez peut-être aussi