Assignment #2
clear, clc
x=2, y=5 %Set variable Quantities (y*x^3)/(x-y) %Part a. (3*x)/(2*y) %Part b. 3/2*x*y %Part c. x^5/(x^5-1) %Part d.
x =
2
y =
5
ans =
-13.3333
ans =
0.6000
ans =
15
ans =
1.0323
x=3, y=4 %Set variable quantities for problem 3. (1-1/x^5)^(-1) %Part a. 3*pi*x^2 %Part b. 3*y/(4*x-8) %Part c. 4*(y-5)/(3*x-6) %Part d.
x =
3
y =
4
ans =
1.0041
ans =
84.8230
ans =
3
ans =
-1.3333
r=5 V=4/3*pi*r^3 %Volume of sphere. V = V + 0.3*V %Volume of 20% larger sphere. (3*V/(4*pi))^(1/3) %Radius of this larger sphere.
r =
5
V =
523.5988
V =
680.6784
ans =
5.4570
x = [1:0.2:5]; y = 7*sin(4*x) length(y) %The number of elements for y. y(3) %The third element of y.
y =
Columns 1 through 9
-5.2976 -6.9732 -4.4189 0.8158 5.5557 6.9255 4.0944 -1.2203 -5.7948
Columns 10 through 18
-6.8542 -3.7560 1.6206 6.0141 6.7596 3.4048 -2.0153 -6.2130 -6.6419
Columns 19 through 21
-3.0420 2.4032 6.3906
ans =
21
ans =
-4.4189