0% found this document useful (0 votes)
36 views

Assignment 2

The document describes two tasks: 1) a function that takes two vectors of different sizes, pads them with zeros to be the same size, and returns their element-wise sum, and 2) plotting the function e^(-0.2x)sin(x) between 0 and 6π.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Assignment 2

The document describes two tasks: 1) a function that takes two vectors of different sizes, pads them with zeros to be the same size, and returns their element-wise sum, and 2) plotting the function e^(-0.2x)sin(x) between 0 and 6π.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

In-Lab Task 01:

Make a function ‘mysum’ which takes two vectors x and y as input. The vectors should have
different sizes. Firstly, make size of both the input vectors same by padding (concatenating)
zeros. Now add both the vectors element wise. The function should return a variable z which
should contain the sum of all the elements of the vectors formed as a result of summation of
input vectors x and y.
Task 02:
Plot a function e^ (-0.2 x). sin(x) between the interval 0 𝑡𝑜 6𝜋.

You might also like