<jupyter_start><jupyter_text>Linear Algebra for ECE Laboratory 6: Matrix Operations Now that you have a fundamental knowledge about representing and operating with vectors as well as the fundamentals of matrices, we'll try to the same operations with matrices and even more. ObjectivesAt the end of this activity you will be able to:1.   Be familiar with the fundamental matrix operations.2.   Apply the operations to solve intemediate equations.3.   Apply algebra in engineering solutions.  Discussion<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline<jupyter_output><empty_output><jupyter_text>Transposition One of the fundamental operations in matrix algebra is Transposition. The transpose of a matrix is doneby flipping the values of its elementsover its diagonals. $A^T$ $$A = \begin{bmatrix} 1 & 2 & 5\\5 & -1 &0 \\ 0 & -3 & 3\end{bmatrix} $$<jupyter_code>A = np.array([
              [1, 2, 5],
              [5, -1, 0],
              [0, -3, 3]
])
A
AT1 = np.transpose(A)
AT1
AT2 = A.T
AT2
np.array_equiv(AT1, AT2)
B = np.array([
              [1,2,3,4],
              [1,0,2,1],
])
B.shape
np.transpose(B).shape
B.T.shape<jupyter_output><empty_output><jupyter_text>TRY<jupyter_code>M=np.array([
    [2,1,6],
    [1,3,4]        
])
M.shape
np.transpose(M).shape
M.T.shape<jupyter_output><empty_output><jupyter_text><jupyter_code>X = np.array([
              [1,2],
              [0,1],
])
Y = np.array([
    [-1,0],
    [2,2]
])
np.dot(X,Y)
X.dot(Y)
X @ Y
np.matmul(X,Y)<jupyter_output><empty_output><jupyter_text>TRY<jupyter_code>C = np.array([
              [1,2,3],
              [0,1,2],
              [2,1,0]
])
K = np.array([
    [-1,0,1],
    [2,2,2],
    [1,2,3]
])
np.dot(C,K)
C.dot(K)
C @ K
np.matmul(C,K)<jupyter_output><empty_output><jupyter_text><jupyter_code>M = np.array([
              [1,2],
              [6, -2],
              [5,3]
])
E = np.array([
              [2,4],
              [8,7],
              [-4, -9]
])
B = np.array([
              [0,1,2],
              [9,1,1]
])
print(M.shape)
print(E.shape)
print(B.shape)
M @ B
E @ B
M @ E
X = np.array([
              [1,2,3,0]
])
Y = np.array([
             [1,0,4,-1] 
])
print(X.shape)
print(Y.shape)
Y.T@ X
X @ Y.T<jupyter_output><empty_output><jupyter_text><jupyter_code>A = np.array([
              [4,2,1],
              [5,4,1],
              [2,1,3]
])
M= np.array([
             [3,5,7],
             [6,1,7],
             [3,1,8]
           

])
P= np.array([
             [1,1,8],
             [0,1,1],
             [1,9,1]
])
print(A.shape)
print(M.shape)
print(P.shape)


A1 = A @ M
A1
A2 = M @ A
A2
np.array_equiv(A1,A2)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16592095451155853, 'fraction_numerical': 0.04735272184936615, 'mean_word_length': 2.3123456790123456, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '553596', 'license': 'Apache-2.0', 'n_tokens_mistral': 1104, 'n_tokens_neox': 1082, 'n_words': 235, 'path': 'Untitled1.ipynb', 'repo_name': 'ckxmrls/kayedocs', 'size': '2682'}