Create The Following Vectors A (1 2 2 3 1 2 2) B (1 2 2 2 2 2 2) C (1 2 2 3 3 3 4)

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

SIGNAL SPECTRA AND SIGNAL PROCESSING

LABORATORY EXERCISE NO. 1


INTRODUCTION TO MATLAB

Create the following vectors


A=[1 2 2 3 1 2 2]
B=[1 2 2 2 2 2 2]
C=[1 2 2 3 3 3 4]

Answer the following:

1. Concatenate A and B

2. Calculate the sum of all elements in A and B respectively


3. Add each element of A with the 7 element of C
th

4. Use the operator ‘:’ (colon) to create vectors of number series from 1 to 20 stored to variable F
and number series of 10 to 25 stored to variable G

5. Create a vector with elements of 20 zeros in one column


6. Create a vector with elements of ones in 20x20 matrix
7. Generate a vector composed of first 4 elements of A and last 5 elements of C.

Critical Thinking Questions:


1. What are your observations in the result of procedure 4?

2. What are the differences in using editor and command window?

3. What are the errors you encountered while performing the task? How did these errors happen?
Explain how did you correct the errors

You might also like