%N1 for 3 noded triangle
[s,t] = meshgrid(0:0.01:1);
z = t;
z(s+t > 1) = nan;
surf(s,t,z)

% N1 for 6-noded triangle
[s,t] = meshgrid(0:0.01:1);
z = t.*(2*t-1);
z(s+t > 1) = nan;
surf(s,t,z)

% N4 for 6 noded triangle
[s,t] = meshgrid(0:0.005:1);
z = 4*s.*t;
z(s+t > 1) = nan;
surf(s,t,z)

% N1 for 4-noded rectangle
[s,t] = meshgrid(-1:0.025:1);
z = 0.25*(s-1).*(t-1);
surf(s,t,z)

% N1 for 8-noded rectangle
[s,t] = meshgrid(-1:0.025:1);
z1 = 0.25*(1-s).*(1-t);
z = -z1.*(t+s+1);
surf(s,t,z)

% N5 for 8-noded rectangle
[s,t] = meshgrid(-1:0.025:1);
z1 = 0.5*(1-s).*(1-t);
z = z1.*(t+1);
surf(s,t,z)