Matlab Activity (Vectors) PDF

Title Matlab Activity (Vectors)
Course Fundamentals Of Matlab Programming
Institution Technological Institute of the Philippines
Pages 5
File Size 333.2 KB
File Type PDF
Total Downloads 83
Total Views 135

Summary

Vectors in MATLAB...


Description

MATLAB ACTIVITY 5 – Vectors in MATLAB

Do the following step, then answer the questions below. Write the MATLAB SYNTAX you used and MATLAB out put on the space provided

1. Create a row vector d of 20 equally spaced elements from 1 to 10. Name the vector C. 2. Create a row vector d of 20 equally spaced elements from 2 to 5. Name the vector D. 3. Use MATLAB to plot the vector C and D. 4. Plot again vector C and D using different color.

MATLAB syntax and output for numbers 1-4

1. C = linspace(1,10,20)

2. D = linspace(2,5,20)

3. plot(C,D)

4. plot(C,D,'r')

Question 1: Describe the vectors C and D.

-

There are 20 elements from numbers 1-10 in vector C. And there are 20 elements from numbers 2-5 in vector D. Even though they have the same number of elements, the interval of the numerical values in vector C is larger as compared to vector D since there are up to 10 choices of whole numbers.

Question 2: Describe the plot/graph of vectors C and D. -

Elements in vector C represents the points in the x-axis, while elements in vector D represents the points in the y-axis. And based from the graph, the line of vectors C and D does not pass the points (0, 0).

B. Enter and plot the transpose of following vectors, then answer the question below. 1.

u= [2 6 4 ] , v=[ 6 2 5 ]

2.

u= [ 3 −5 4 ] , v= [ 7 −1 −2 ]

3.

u= [ 4 0 −5 ] , v= [ 0 6 3 ]

MATLAB syntax and output for numbers 1-3 (B) 1.

2.

3.

Question 1: Describe and differentiate the three graphs. -

On each graph, two lines meet each other at a specific point in the Cartesian plane which forms an angle or opening. I observed that the lines in the first graph has a small opening as compared to the second and third graph since the values of u and v are only positive integers. This means that the first

graph does not pass points (0,0) as compared to the second and third graph. I also noticed that the opening of the third graph is facing downwards while the opening of the first and second graph is facing upwards. In my opinion, the larger the interval of the elements that is plotted, the larger will be the angle formed by the two lines that meet each other at a certain point....


Similar Free PDFs