Use Python: Define the following vectors and matrices: vec1 = np.array([ -1., 4., -9.]) mat1 = np.array([[
Fantastic news! We've Found the answer you've been seeking!
Question:
Use Python:
Define the following vectors and matrices:
vec1 = np.array([ -1., 4., -9.])
mat1 = np.array([[ 1., 3., 5.], [7., -9., 2.], [4., 6., 8. ]]
1. You can multiply vectors by constants. Compute
vec2 = (np.pi/4) * vec1
2. The cosine function can be applied to a vector to yield a vector of cosines.
Compute
vec2 = np.cos( vec2 )
3. You can add vectors and multiply by scalars. Compute
vec3 = vec1 + 2 * vec2
4. The Euclidean norm of a matrix or a vector is available using la.norm.
Compute
la.norm(vec3)
Related Book For
Posted Date: