我有一个数组:
step1 = [0,0;
0,1;
1,1;
2,3;
3,4;
3,5;
3,6;
3,7;
4,7;
5,7;
6,7;
6,6;
6,5;
6,4;
6,3;
6,2;
5,1];
我想单步执行这个数组并为从一行到另一行递增 0.1 的行和列创建新数组。这就是我所做的:
z=1;
u=length(step1);
step_b4X = zeros(u,1);
step_b4Y = zeros(u,1);
while z <= length(step1)
step_b4X = step_presentX;
step_presentX(z,1) = step1(z,1);
step_b4Y = step_presentX;
step_presentY(z,1) = step1(z,2);
pathX = step_b4X:0.1:step_presentX;
pathY = step_b4Y:0.1:step_presentY;
z = z+1;
end
我得到零。我想要 pathX = 0:0.1:0....pathY = 0:0.1:1 next pathX = 0:0.1:1....pathY = 1:0.1:1... 等等