%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Contour- ja contourf-funktiot, esimerkkejä.
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

N = 100;
x = linspace(-pi,pi,N);
y = linspace(-pi,pi,N);

%% z = f(x,y) = sin(x)cos(y)
for i = 1:N
  for j = 1:N
    z(j,i) =  x(i)^2 + y(j)^2;
  end
end
  
%% Funktion z=f(x,y) tasa-arvokäyrägraafi
contourf(x,y,z);
colormap(hot);