3D mesh/surf plot puzzle
显示 更早的评论
The following codes produces a 2D image and its corresponding 3D demonstration. However, the pixel in the 2D image as a square becomes a grid-point in the 3D image. That's why the 3D image has a sharp top, rather than a square cylinder. I'm wondering how I can display a 2D matrix in a 3D manner without such pixel->grid-point conversion? For example, I would like to see a square cylinder with a flat top in the 3D image, but not a triangle stuff.
img = zeros(5,5);
img(3,3) = 10;
subplot(121)
imagesc(img); axis image
subplot(122)
mesh(img)
% shading interp
colorbar
set(gcf, 'position', [2111 475 560 420])
axis tight

采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Image Arithmetic 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!