MatLab Programming

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

ENG3202 Computer Programming

Assignment 1

Name : …………….

Matric No: …………….

Please copy the answers from MATLAB command, if “error” please comment
and give the solutions below the question.

1. Open the MATLAB

2. Exit the MATLAB

3. The following problems can be solved by computer programming. Write the


right MATLAB command for the following problems:

a) 11 + 12 = ……………….

b) 2 x 3 = …………………

c) 5 ÷ 6 = ……………….

d) 1234 - 345 = …………………..

e) ln(5) = …………….

f) log(5) = …………

g) sin(pi/6) = ……………..

h) sind(30) = ……………..

i) cot(30) = …………..

j) e5 = ………………….

k) √45 = …………………

l) 54 = ………………..
ENG3202 Computer Programming

Assignment 2

The following problems can be solved by writing commands in the Command


Window, or by writing a program in a script file and then executing the file.

1.

2.

3.

4.

5.

6. Define the variables x = 1.88, then evaluate:

7. Define the variables a, b, c and d as:

8. In the below triangle shown in Figure 1, a = 16 cm and c = 50 cm. Define a and c


as variables, and then:
(a) Using the Pythagorean theorem, calculate b by typing one line in the
Command Window.
(b) Using b from part (a) calculate the angle α in degrees by typing one line in the
Command Window.

Figure 1: Triangle

You might also like