I'm not familiar with Python.

Could anyone help me to convert the following 2 functions into Matlab or languages like C#, C++ or pascal?

- Code: Select all
`def nabla(I):`

h, w = I.shape

G = np.zeros((h, w, 2), I.dtype)

G[:, :-1, 0] -= I[:, :-1]

G[:, :-1, 0] += I[:, 1:]

G[:-1, :, 1] -= I[:-1]

G[:-1, :, 1] += I[1:]

return G

def nablaT(G):

h, w = G.shape[:2]

I = np.zeros((h, w), G.dtype)

# note that we just reversed left and right sides

# of each line to obtain the transposed operator

I[:, :-1] -= G[:, :-1, 0]

I[:, 1: ] += G[:, :-1, 0]

I[:-1] -= G[:-1, :, 1]

I[1: ] += G[:-1, :, 1]

return I

Thanks a lot!