matlab随机矩阵乘法及点的显示?x1——x7是我已经定义了的随机变量矩阵1*10000for i=1:10000A1=[1 0 cos(x6(i)) 0;sin(x6(i)) 0 -cos(x6(i)) 0;0 1 0 0;0 0 1 1]A2=[0 -1 0 0;1 0 0 x1(i);0 0 1 x2(i);0 0 0 1]A3=[1 0 0 x3(i);0 1 0 0;0 0 1
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 08:02:51
matlab随机矩阵乘法及点的显示?x1——x7是我已经定义了的随机变量矩阵1*10000for i=1:10000A1=[1 0 cos(x6(i)) 0;sin(x6(i)) 0 -cos(x6(i)) 0;0 1 0 0;0 0 1 1]A2=[0 -1 0 0;1 0 0 x1(i);0 0 1 x2(i);0 0 0 1]A3=[1 0 0 x3(i);0 1 0 0;0 0 1
matlab随机矩阵乘法及点的显示?
x1——x7是我已经定义了的随机变量矩阵1*10000for i=1:10000A1=[1 0 cos(x6(i)) 0;sin(x6(i)) 0 -cos(x6(i)) 0;0 1 0 0;0 0 1 1]A2=[0 -1 0 0;1 0 0 x1(i);0 0 1 x2(i);0 0 0 1]A3=[1 0 0 x3(i);0 1 0 0;0 0 1 0;0 0 0 1]A4=[-cos(pi/4) sin(pi/4) 0 -(x4(i)).*cos(pi/4);-sin(pi/4) -cos(pi/4) 0 -(x4(i)).*sin(pi/4);0 0 1 0;0 0 0 1]A5=[cos(x7(i)) 0 -cos(x7(i)) 0;sin(x7(i)) 0 cos(x7(i)) 0;0 -1 0 0;0 0 0 1]A6=[1 0 0 0;0 1 0 0;0 0 1 x5(i);0 0 0 1]end现在我想用T=(A1)*(A2)*(A3)*(A4)*(A5)*(A6)得到10000个T,并用 plot3(T(1,4),T(2,4),T(3,4),'r*') 把这10000个点显示出来?请问该怎么办?
matlab随机矩阵乘法及点的显示?x1——x7是我已经定义了的随机变量矩阵1*10000for i=1:10000A1=[1 0 cos(x6(i)) 0;sin(x6(i)) 0 -cos(x6(i)) 0;0 1 0 0;0 0 1 1]A2=[0 -1 0 0;1 0 0 x1(i);0 0 1 x2(i);0 0 0 1]A3=[1 0 0 x3(i);0 1 0 0;0 0 1
x1=1:10000; x2=1:10000; x3=1:10000; x4=1:10000; x5=1:10000; x6=1:10000; x7=1:10000;
for i=1:10000
A1=[1 0 cos(x6(i)) 0;sin(x6(i)) 0 -cos(x6(i)) 0;0 1 0 0;0 0 1 1];
A2=[0 -1 0 0;1 0 0 x1(i);0 0 1 x2(i);0 0 0 1];
A3=[1 0 0 x3(i);0 1 0 0;0 0 1 0;0 0 0 1];
A4=[-cos(pi/4) sin(pi/4) 0 -(x4(i)).*cos(pi/4);-sin(pi/4) -cos(pi/4) 0 -(x4(i)).*sin(pi/4);0 0 1 0;0 0 0 1];
A5=[cos(x7(i)) 0 -cos(x7(i)) 0;sin(x7(i)) 0 cos(x7(i)) 0;0 -1 0 0;0 0 0 1];
A6=[1 0 0 0;0 1 0 0;0 0 1 x5(i);0 0 0 1];
T=(A1)*(A2)*(A3)*(A4)*(A5)*(A6);
figure(1);
plot3(T(1,4),T(2,4),T(3,4),'-r*') ;
grid on; hold on;
end