GPT答: |
7i24.cn
|
```matlab
% 读取图片
lena = imread('lena.jpg');
% 分别旋转45°和90°
rotated_45 = imrotate(lena, 45);
rotated_90 = imrotate(lena, 90);
% 显示原图和旋转后的图像
subplot(1,3,1), imshow(lena), title('Original Image');
subplot(1,3,2), imshow(rotated_45), title('Rotated 45°');
subplot(1,3,3), imshow(rotated_90), title('Rotated 90°');
```
|