MATLAB错误-未定义函数“;imrotate“;对于类型为';int16&x27;

MATLAB错误-未定义函数“;imrotate“;对于类型为';int16&x27;,matlab,undefined,uint16,Matlab,Undefined,Uint16,我不知道发生了什么事。我需要一些关于这个问题的建议或解决方案 以下代码为: ax_slice = reshape(im(:,:,slices/2),rows,cols); sag_slice = reshape(im(:,cols/2,:),rows,slices); cor_slice = reshape(im(rows/2,:,:),cols,slices); figure; subplot(2,2,1);imshow(ax_slice,[]); ax_slice_rot = imrotat

我不知道发生了什么事。我需要一些关于这个问题的建议或解决方案

以下代码为:

ax_slice = reshape(im(:,:,slices/2),rows,cols);
sag_slice = reshape(im(:,cols/2,:),rows,slices);
cor_slice = reshape(im(rows/2,:,:),cols,slices);
figure;
subplot(2,2,1);imshow(ax_slice,[]);
ax_slice_rot = imrotate(ax_slice,180);
subplot(2,2,1);imshow(ax_slice_rot,[]);
subplot(2,2,2);imshow(sag_slice,[]);
sag_slice_rot = imrotate(sag_slice,90);
imshow(sag_slice_rot,[]);
subplot(2,2,3);imshow(cor_slice,[]);
cor_slice_rot = imrotate(cor_slice,90);
imshow(cor_slice_rot,[]);
错误如下所示:

Undefined function 'imrotate' for input arguments of type 'int16'.

Error in lab0_introduction (line 19)
ax_slice_rot = imrotate(ax_slice,180);

非常感谢

正如其他人所说,这通常是因为您没有安装。检查此项的最简单方法是键入以下内容:

 which('imrotate')
如果结果是这个语句

imrotate是一个变量

这意味着你不小心给了一个变量这个名字,所以MATLAB无法找到真正的函数。要修复此问题,您需要运行以下命令

clear imrotate 
但是,如果
命令的结果为

找不到“imrotate”


这意味着您当前的系统上没有安装图像处理工具箱。

它是系统的一部分。您没有安装该工具箱,或者创建了一个名为
imrotate
的变量。要检查是否安装了该工具箱,请在命令窗口中键入
ver
。将弹出一些有关Matlab安装的信息,以及所有已安装工具箱的列表。