To perform restricted GMM estimation, just click the Estimation drop-down menu and select the Unrestricted entry. What you should see is the following

Note that some new fields will show up, located at the bottom-left of the window, under the general title Restrictions. Apart from these fields, all the rest are identical with the ones used in the unrestricted GMM case and thus, we are not analyze them here; you can visit the unrestricted GMM help file to check their definitions.
The restrictions fields are:

[0.5 ; 0 ; -Inf]. [1 ; 10 ; Inf]. function [a , constr, b, constr_derivative] = constrfun(theta, varargin)
Inputs
theta: A vector with the same size as the GMM estimates (i.e. Px1).
varargin : This input is only for compatibility purposes. You must include it as the second input argument of the function. YOU DON'T NEED TO REFER TO IT WITHIN YOUR CODE.
LINEAR
Suppose that you want to estimate 6 parameters, , denoted by θi, i=1, 2,...,6 subject to the following two constraints
θ1 + 0.5 θ2 - θ3 = 0
-θ3 + θ6 = - θ5
θ4 = 5 - θ1
The three linear constraints can be expressed in the form Rθ = r, where θ is a 6x1 vector of the parameters, R is a 3x6 matrix, and r is 3x1.
The constraints must be written in a form sush that, if they are satisfied, their value is zero. In this case, the constraints will simply be defined as Rθ - r.
With that in mind, we create the following Matlab function that calculates the value and the derivative of the above constraints.
% ------------------------------- Sample code starts here -------------------------------
function [useless1, constraint, useless2, deriv_constr] = constrdemo1(theta, varargin)
useless1 = [ ]; % Set the first output element equal to an empty matrix since it is useless
useless2 = [ ]; % Same as above
R = [ 1 0.5 -1 0 0 0; 0 0 -1 0 1 1; 1 0 0 1 0 0];
r = [0 ; 0 ; 5]
constraint = R*theta - r;
deriv_constr = R;
% ------------------------------- Sample code ends here -------------------------------
NONLINEAR
Now, suppose that you want to estimate the same six parameters as above subject to the following linear/nonlinear constraints
θ1 - θ3 = 0
sin(θ4 +θ6) = θ2
In this case the function used is
% ------------------------------- Sample code starts here -------------------------------
function [eraseme1, cons, eraseme2, der] = constrdemo2(theta, varargin)
eraseme1 = [ ]; % Set the first output element equal to an empty matrix since it is useless
eraseme2 = [ ]; % Same as above
first_constr = theta(1,1) - theta(3,1);
second_constr = sin(theta(4,1) + theta(6,1)) - theta(2,1);
cons = [first_constr ; second_constr];
% Derivative of the first constraint w.r.t. θ.
der1 = [1 0 -1 0 0 0];
% Derivative of the second constraint w.r.t. θ.
der2 = [0 -1 0 cos(theta(4,1)+theta(6,1)) 0 cos(theta(4,1)+theta(6,1))];
der = [der1 ; der2]
% ------------------------------- Sample code ends here -------------------------------