直接用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))