我可以使用imagesc
在X-Y平面上获得图像图,但现在我希望将它放在X-Z平面上以供进一步使用。有没有办法这样做?谢谢!
答案 0 :(得分:3)
我使用surface
代替imagesc
:
INPUT = [3,4,5
4,5,6];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure();
ZZ = padarray(INPUT,[1 1],0,'post'); % See note #2
[XX,YY] = meshgrid((1:size(INPUT,2)+1)-0.5,(1:size(INPUT,1)+1)-0.5);
% imagesc
subplot(3,1,1); imagesc(INPUT); xlim([0 4]); ylim([0.5 2.5]);
view([-50 50]); xlabel('x'); ylabel('y'); zlabel('z'); grid on;
title('imagesc');
% Normal (X-Y):
subplot(3,1,2); surface(XX,YY,0*XX,ZZ,'EdgeColor','none','FaceColor','flat');
view([-50 50]); xlabel('x'); ylabel('y'); zlabel('z'); axis ij; box on; grid on;
title('X-Y surface'); caxis([min(INPUT(:)),max(INPUT(:))]);
% Rotated (X-Z):
subplot(3,1,3); surface(XX,0*ZZ,YY,ZZ,'EdgeColor','none','FaceColor','flat');
view([-50 50]); xlabel('x'); ylabel('y'); zlabel('z'); axis ij; box on; grid on;
title('X-Z surface'); caxis([min(INPUT(:)),max(INPUT(:))]);