Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Matlab中旋转轴对象_Matlab_Rotation_Axes - Fatal编程技术网

如何在Matlab中旋转轴对象

如何在Matlab中旋转轴对象,matlab,rotation,axes,Matlab,Rotation,Axes,我正在寻找一种在Matlab中旋转图像的方法。我曾尝试使用rotate和imrotate来实现这一点,但这两个函数对我都不起作用。有人知道如何解决我的问题吗 imshow(imread('theImage.png'),'Parent',handles.axes3); imrotate(handles.axes3, 45); %simply doesn't work set(handles.axes3,'Rotation',45); %no 'Rotation' in axes %I don't

我正在寻找一种在Matlab中旋转图像的方法。我曾尝试使用
rotate
imrotate
来实现这一点,但这两个函数对我都不起作用。有人知道如何解决我的问题吗

imshow(imread('theImage.png'),'Parent',handles.axes3);

imrotate(handles.axes3, 45); %simply doesn't work
set(handles.axes3,'Rotation',45); %no 'Rotation' in axes
%I don't even know how to use just rotate()

为了清楚起见,无法旋转
对象。但您可以旋转图像数据,然后以旋转状态再次显示它们

函数
imrotate
会旋转输入中提供的“图像数据”,并返回表示旋转图像数据的矩阵。因此,在您的情况下,不要在读取文件后直接显示。获取变量中的图像数据,使用
imrotate
旋转该数据,然后显示旋转后的图像(或使用它执行所需操作)

例如:

img = imread('peppers.png') ; %// get the image data into the variable "img"
img2 = imrotate(img,90) ;     %// get the "rotated" image data into the variable "img2"

%// display both "img" and "img2"
subplot(1,2,1) ; imshow( img ) 
subplot(1,2,2) ; imshow( img2 ) 
将产生:

展示您的尝试,然后我们才能真正帮助您?一个负号,因为我只发布了函数名而不是代码?虽然它可能不一定值得投反对票,但仅仅提到您尝试的函数名并没有多大帮助。该函数可能是正确的,但调用时使用了错误的参数。如果你向某人寻求帮助,尽量让他们知道,而不是仅仅为了指出你的问题而提出几个额外的问题。