matlab的三维球体旋转

sphere(50);
[x,y,z]=sphere();
surf(12x,12y,12*z)
% 着色方式
shading flat;

% 在 (-3, -1, 3) 位置添加光源
light('Position', [-3 -1 3]);
material shiny;

% 设置图像颜色值 , 白色 , 默认灰色
set(gcf, 'Color', 'w');

% 坐标轴样式 square
axis equal;
谁能帮帮我怎么样让这个求从左向右自转起来

你好,你看看这个是不是你需要的,有帮助望采纳哟,谢谢啦

%sphere(50);
[x,y,z]=sphere();
for i = 1:100
    figure(1); clf
    dtheta = -pi/50;
    c = cos(dtheta);
    s = sin(dtheta);
    x1 = x;
    y1 = y;
    x = x1*c + y1*s;
    y = -x1*s + c*y1;
surf(12*x,12*y,12*z)
% 着色方式
shading flat;

% 在 (-3, -1, 3) 位置添加光源
light('Position', [-3 -1 3]);
material shiny;

% 设置图像颜色值 , 白色 , 默认灰色
set(gcf, 'Color', 'w');

% 坐标轴样式 square
axis equal;
pause(0.2)
end