MATLAB: Creating Matrix Using Existing Matrix

creating matrixhorizontal shearmatrix manipulation

Hi, How do you create a matrix (not just a plot) that is a horizontal shear of a 2×2 identity matrix? For example, how do you create A=[1 2 ; 0 1] (identity horizontally sheared by 2)? Inputting the entries directly (A=[1 2 ; 0 1]) is not an answer that I'm looking for.
Thank you.

Best Answer

SheerFactor = 2;
sheermat = eye(2);
sheermat(1,2) = SheerFactor;
Related Question