You are on page 1of 3

IT Workshop (MATLAB) Sessional 1

A. Mustafi

July 15, 2019


0.1 Problem Set
0.1.1 Calculate the output for the following in MATLAB:
1
1. 2

2. −52

3. (−5)2

4. 10 − 6/2

5. 5 ∗ 4/2 ∗ 3

0.1.2 Generate the following using appropriate commands in MAT-


LAB:
1. real number in the range [0, 1]

2. real number in the range [0, 100]

3. real number in the range [20, 35]

4. random integer in the exclusive range from 20 to 35

0.1.3 What are the results for the following and why?
1. 3 == 5 + 2

2. 0 b 0 <0 a 0 + 1

3. 10 > 5 + 2

4. 0 c 0 ==0 d 0 − 1&&2 < 4

5. xor(’c’==’d’-1, 2>4)

0.1.4 Calculate the values of:


p
1. 19

2. 31 .2

3. tan(π)

1
0.1.5 Programs
1. Write a program in MATLAB to convert Farenheit temeperatures to Centi-
grades.

2. The combined resistance of three different resisitances R1, R2, R3 is given


as
1
Rt = 1 1 1
R1 + R2 + R3 +
Write a program in MATLAB to calculate the combined resistance for any
three resistance values. You can initialize three variables to hold the values
of the three resistances.

3. Mathematically the Lorentz factor in the theory of relativity is given as:

1
γ= q
2
1 − vc 2

. If the speed of light c is 3x108 m/sec. Find the Lorentz factor for some
given variable.

4. The cost of a cylindrical container is given by C = 32430


r + 428πr , where r
is the radius of the container. Find the cost of the container for any given
radius.

5. Find the geometric mean of a set of five positive integers.

You might also like