Sunteți pe pagina 1din 2

King Saud University

College of Computer and Information Sciences


Department of Computer Engineering
Course/ Tutorial No: 340 CEN/1.
Date; Due date: 27/8/1436; 30/8/1436
No of questions: 4

3582
3421

I. Suppose you have the following matrice A:

A=

2
1
1
1

2
3
2
3

3
1
2
1

2
2
1
2

1- Give the related command to enter A to MATLAB.


2- Find the following:
a. Sum of each line of A
b. Sum of each column of A.
II. Now suppose you have also the following matrice B:

B=

1
2
3
4

2
3
2
3

3
3
2
1

2
2
1
2

1- Find A * B element by element.


2- Find A/B element by element.
III. Obtain the following using one MATLAB statement only:
a- 4 elements x-vector starting by 0 and ending by 6.
b- 4 elements x-vector starting by 0, ending by 6 with a step of 2.
c- Draw the conclusion.

Tut1/340CEN/56s

IV. Using MATLAB, plot the following graphs in the range -2 to 2 (for 50 points):
ys(x) = 5 sin(t) with green solid line.
yc(x) = 6 cos(t) with black dashdot line.
&
- Add a comment t in Radian.
- Label the t-axis with radian.
- Label the y-axis with volt.
- Title the plot with ys= 5sin(t) and yc= 6cos(t).
- Display the legend for ys & yc.

Tut1/340CEN/56s

S-ar putea să vă placă și