x=input(' Do you want a contour (c) or a mesh plot (m)');
if( x == 'm')
mesh(xx,yy,zz)
else
contour(xx,yy,zz,20)
end
Nested if-statements.
The following gives a `double' step function, i.e. a function that jumps at x=0 and again at x=1:
function [y] = twostep(x)
if x <= 0
y=0;
else
if x <= 1
y = 1;
else
y = 2;
end
end