I am trying to convert a MATLAB code in Python. I don\'t know how to initialize empty matrix in Python.
MATLAB Code:
demod4(1) = [];
M=[] n=int(input()) m=int(input()) for j in range(n): l=[] for k in range(m): l.append(0) M.append(l) print(M)
This is the traditional way of doing it matrix[m,n], However, python offers many cool ways of doing so as mentioned in other answers.