Wk 3 C1W3 Assignment

Hi,
I am struggling with Wk 3 Exercise 1. I am stuck with defining the transformation matrix, I have tried every option that I can think of but nothing is working. The parameter v is a numpy array of vectors to be stretched, what do you put in the brackets to define the transformation matrix in T?
This has been puzzling me for hours and I keep getting it wrong.
Many thanks in advance for anyone that can help.

When creating a post, please add:

  • Week # must be added in the tags option of the post.
  • Link to the classroom item you are referring to:
  • Description (include relevant info but please do not post solution code or your entire notebook)

For T_stretch(), which is a linear transformation, you’re essentially using an identity matrix, but the non-zero elements on the main diagonal are ‘a’ instead of 1.

1 Like

Update:

To specify a matrix, the np.array() syntax requires the vectors to be enclosed in an outer set of square brackets.

The notebook has a good example in the cell that defines the “L()” function.