在MATLAB中怎么输入三角函数cos sin

如题所述

第1个回答  2015-11-12

直接用rotx函数,

【Syntax】

R = rotx(ang)


【Description】

R = rotx(ang) creates a 3-by-3 matrix used to rotated a 3-by-1 vector or 3-by-N matrix of vectors around the x-axis by ang degrees. When acting on a matrix, each column of the matrix represents a different vector. For the rotation matrix R and vector v, the rotated vector is given by R*v.


追问

你是怎么写的,能把代码发过来么

追答

比如想求theta = 180度时的矩阵,直接:
>> rotx(180)
如果角度是弧度的话用rad2deg转换下:
>> rotx(rad2deg(pi))

本回答被网友采纳
相似回答