Define Test Function Generate Covariance Matrix Input Vector Example Input V 1 2 5 Matrix Q37021560

  1. Define and test a function to generate the covariance matrixfor an input vector. For example, if the input is v=[1, 2, 5], thenthe matrix is v*vT =

1   2     5

2   4    10

5 10   25

I need to program this in Python 3 defined as a function asapplease. thank you.


Solution


def asap(y): #function definition print( v*vT= ) for i in range(e,n): for j in range(0,n): print (v[j]v[i], ,end-*) #pr

Output:-

Command Prompt licrosoft Windows [Version 10.0.17134.706] (c) 2018 Microsoft Corporation. All rights reserved. : Users Hp>c

def asap(y): #function definition print( “v*vT=” ) for i in

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.