Numpy
| Numpy | Matlab | |
|---|---|---|
| x+y | np.add(x,y) | |
| x-y | np.subtract(x,y) | |
| x*y | np.multiply(x,y) | x .* y |
| x/y | np.divide(x,y) | |
| np.sqrt(x) | ||
| np.sum(x) | sum(sum(x)) | |
| np.sum(x ,axix=0) | sum(x) | |
| np.sum(x, axix=1) | sum(x ,2) | |
| dot, inner product | x.dot(y) = np.dot(x,y) | x * y |
| transpose | x.T | x' |
| stack | np.tile(x, (m, n)) | remat(x, m, n) |
Referrence