Question: Write a f unction that takes two scalar inputs: x and y, and returns one scalar output: z. z = (x+y)^2. Example: if x=1 and

 Write a f unction that takes two scalar inputs: x and

Write a f unction that takes two scalar inputs: x and y, and returns one scalar output: z. z = (x+y)^2. Example: if x=1 and y=2, then z = (1+2)^2 = 9. b. Write another function that uses the function that you wrote in part-a above such that the new function the takes two array inputs: X and Y and gives one array output: Z. Each element of Z is the square of the sum of the corresponding elements in X and Y. Example: if X = [1 2 3] and Y = [2 1 6], then Z = [(1+2)^2 (2+1)^2 (3+6)^2 = [9 9 8 1]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!