function y=f(x)
    y=x*x/10+sin(x)
endfunction

x=-2*%pi:0.1:2*%pi
clf
plot(x,f)

// surface
function y=f2arg(x1, x2) // function with 2 arguments
    y = x1 **2 + x2 **2;
endfunction
x1data = linspace ( -1 , 1 , 100 ); // this is equivalent with x1data = -1:0.1:1;
x2data = linspace ( -1 , 1 , 100 );
contour ( x1data , x2data , f2arg , 10)  // contour plot
pause
clf                                     // clean the screen
fplot3d( x1data , x2data , f2arg)       // surface plot
