发布网友 发布时间:2022-04-21 18:56
共1个回答
热心网友 时间:2023-06-24 16:15
clear;clc;close all
w=[0.824074 0.281482 -0.212346 0.864198 -1.882290 -0.110607
0.088272 0.520988 -0.463889 -0.377778 0.785360 8.095795];
N=10000;
x=zeros(1,N);
y=zeros(1,N);
x0=0;
y0=0;
for i=1:N
if rand<0.8
j=1;
else
j=2;
end
x01=w(j,[1 2 5])*[x0,y0,1]';
y01=w(j,[3 4 6])*[x0,y0,1]';
x(i)=x01;
y(i)=y01;
x0=x01;
y0=y01;
end
plot(x,y,'.')