在matlab中怎样把一个矩阵左右翻转和上下翻转和旋转90度

在matlab中怎样把一个矩阵左右翻转和上下翻转和旋转90度,第1张

matlab提供了左右、上下、以及旋转90度直接利用的函数,如下:

左右翻转:fliplr(x)

上下翻转:flipud(x)

旋转九十度:rot90(x)

扩展资料:

rot90(A,k)

功能:将zd矩阵()旋转90度

参数:A——待 *** 作矩阵,k——旋转k90度

详解:将矩阵A旋转k个90度,即旋转90,180,270。一维二维矩阵如只旋转90 度亦可用转置

符号;

适用于一维(数组)、二维、三维

注:旋转方向为逆时针;

flipud(A)

功能:将矩阵()上下翻转

参数:A——待 *** 作矩阵

详解:矩阵A上下翻转,适用于一维(数组)、二维、三维;

fliplr(A)

功能:将矩阵()左右翻转

参数:A——待 *** 作矩阵

详解:矩阵A左右翻转,适用于一维(数组)、二维、三维;

参考资料:

百度百科-rot90

参考资料:

百度百科-flipud

参考资料:

百度百科-fliplr

help rotate

ROTATE Rotate objects about specified origin and direction

ROTATE(H,[THETA PHI],ALPHA) rotates the objects with handles H

through angle ALPHA about an axis described by the 2-element

direction vector [THETA PHI] (spherical coordinates)

All the angles are in degrees The handles in H must be children

of the same axes

THETA is the angle in the xy plane counterclockwise from the

positive x axis PHI is the elevation of the direction vector

from the xy plane (see also SPH2CART) Positive ALPHA is defined

as the righthand-rule angle about the direction vector as it

extends from the origin

ROTATE(H,[X Y Z],ALPHA) rotates the objects about the direction

vector [X Y Z] (cartesian coordinates) The direction vector

is the vector from the center of the plot box to (X,Y,Z)

ROTATE(,ORIGIN) uses the the point ORIGIN = [x0,y0,y0] as

the center of rotation instead of the center of the plot box

See also SPH2CART, CART2SPH

读取坐标:

x=get(hh,'xdata');

y=get(hh,'ydata');

z=get(hh,'zdata');

平移

x=x+2;

y=y+3;

z=z+4;

重设坐标:

set(hh,'xdata',x,'ydata',y,'zdata',z);

还有你这个好像不是曲线旋转为旋转曲面啊,就是用rotate把曲面转了-3°而已

以上就是关于在matlab中怎样把一个矩阵左右翻转和上下翻转和旋转90度全部的内容,包括:在matlab中怎样把一个矩阵左右翻转和上下翻转和旋转90度、matlab中如何将图像的坐标轴进行旋转一定的角度(平面图形),谢了!、我用matlab空间旋转曲面平移等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zz/10622706.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-10
下一篇 2023-05-10

发表评论

登录后才能评论

评论列表(0条)

保存