I want to display the values of a function Z = Z(x,y) in the range (x_min, x_max) and (y_min, y_max) using the contourf function in Matlab 2015a. Here is my code:
N = 20;
x_min = 20;
x_max = 40;
y_min = 40;
y_max = 80;
x = linspace(x_min, x_max, N);
y = linspace(y_min, y_max, N);
[X,Y] = meshgrid(y,x);
Z = X.*Y;
for i = 1:N
for j = 1:N
Z(i, j) = 10*i+j;
end
end
contourf(Z);
colorbar
How can I show the true range of x and y (20<=x=<40 and 40<=y=<80)?