I have this function in Matlab
cn = reshape(repmat(sn, n_rep, 1), 1,[]);
In Python I have the following code:
import numpy as np
from numpy.random import randint
M=2
N=2*10**8 ### valor de Dados
n_rep = 3 ## numero de repetições
sn = randint(0,M,size = N)### Inteiros 0 e 1
print("sn=", sn)
cn_repmat=np.tile(sn,n_rep)
print("cn_repmat=", cn_repmat)
cn=np.reshape(cn_repmat,1,[])
print(cn)
I'm not sure if the right parentheses in python are like this because it gives me the following error
File "C:/Users/Sergio Malhao/.spyder-py3/Desktop/untitled6.py", line 17, in <module>
cn=np.reshape(cn_repmat,1,[])
File "E:\Anaconda3\lib\site-packages\numpy\core\fromnumeric.py", line 232, in reshape
return _wrapfunc(a, 'reshape', newshape, order=order)
File "E:\Anaconda3\lib\site-packages\numpy\core\fromnumeric.py", line 57, in _wrapfunc
return getattr(obj, method)(*args, **kwds)
ValueError: cannot reshape array of size 600000000 into shape (1,)