www.gusucode.com > phased 案例源码 matlab代码程序 > phased/RotationMatrixFor30degXRotationExample.m

    %% Rotation Matrix for 30° Rotation
% Construct the matrix for a rotation of a vector around the x-axis by
% 30°. Then let the matrix operate on a vector.
R = rotx(30)
x = [2;-2;4];
y = R*x
%%
% Under a rotation around the _x_-axis, the x-component of a vector is
% invariant.