Skip to content

Instantly share code, notes, and snippets.

@BigBri92
BigBri92 / repmat.py
Last active August 30, 2017 00:37
One liner for python that simulates repmat from MATLAB. Works for a matrix input as a 2d list
def repmat(matrixA, rowFinal, colFinal):
return [matrixA[i] * colFinal for i in range(len(matrixA))] * rowFinal
@BigBri92
BigBri92 / enter_the_matrix.py
Last active August 30, 2017 00:30
Little script I wrote to make a mock matrix in command line
# Enter The Matrix
import os, time, msvcrt, random
os.system('color 07')
os.system('cls')
x = [1, 2, 3, 4, 5, 6, 8,
15, 20, 21, 32, 32, 32, 32,
32, 33, 35, 36, 37, 38, 48,