Matlab下面程序意思for i =1:size(x,1)theta = unifrnd(0,2*pi);y1(1) = x(i,1) + 1*sin(theta);y1(2) = x(i,2) + 1*cos(theta)y(i,:) = y1;end主要是y1(1) = x(i,1) + 1*sin(theta);y1(2) = x(i,2) + 1*cos(theta)y(i,:) = y1;这三句话
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/26 22:12:48
Matlab下面程序意思for i =1:size(x,1)theta = unifrnd(0,2*pi);y1(1) = x(i,1) + 1*sin(theta);y1(2) = x(i,2) + 1*cos(theta)y(i,:) = y1;end主要是y1(1) = x(i,1) + 1*sin(theta);y1(2) = x(i,2) + 1*cos(theta)y(i,:) = y1;这三句话
Matlab下面程序意思
for i =1:size(x,1)
theta = unifrnd(0,2*pi);
y1(1) = x(i,1) + 1*sin(theta);
y1(2) = x(i,2) + 1*cos(theta)
y(i,:) = y1;
end
主要是
y1(1) = x(i,1) + 1*sin(theta);
y1(2) = x(i,2) + 1*cos(theta)
y(i,:) = y1;
这三句话
Matlab下面程序意思for i =1:size(x,1)theta = unifrnd(0,2*pi);y1(1) = x(i,1) + 1*sin(theta);y1(2) = x(i,2) + 1*cos(theta)y(i,:) = y1;end主要是y1(1) = x(i,1) + 1*sin(theta);y1(2) = x(i,2) + 1*cos(theta)y(i,:) = y1;这三句话
size(x,1)代表矩阵X的行数
theta代表角度θ,其值为0到2π
x代表圆心,x(i,1)代表第i个圆心的横坐标,x(i,2)代表第i个圆心的纵坐标
y1(1)代表第i个圆的圆周上的点的纵坐标,y1(2)代表第i个圆的圆周上的点的横坐标
y(i,:) = y1意为把表示第i个圆的数组作为数组y的第i行元素.