# 3D plot problem

I have a matrix $(A_{10*10})$ in which each elements of matrix states the value of the function $y=f(x,y)$. Since, $y$ shows the enclosed area between two squares, so I don't have the value of these elements in this area. Now my question is that how can I plot the $y$ in termes of $x,y$ in 2D or 3D using matlab while I don't have the values of $y$ in $A(3:5,3:5)$? Thank you in advance.

-

 A=rand(10,10);
h = bar3(A);
colormap jet
colorbar


for change in color you can use this code :

 shading interp
for i = 1:length(h)
zdata = get(h(i),'ZData');
set(h(i),'CData',zdata)
set(h,'EdgeColor','k')
end


-

If you the values A(3:5,3:5) are undefined, set them to NaN and the plotting commands will ignore them. You can then use @AmirAlizadeh's approach with bar3, or draw an image with imagesc. The latter is perhaps less spectacular, but often clearer. In particular, with bar3 it would be hard to see the "hole" in x=3:5, y=3:5.

A=rand(10,10); % example data...
A(3:5,3:5) = NaN; % ...no data here
imagesc(A)
colorbar
axis xy
xlabel 'x'
ylabel 'y'


-