我需要为不同的phiStart和phiExit值填充一个包含90个元素周期的360元素矩阵:
flute = 4;
phiStart = 0;
phiExit = 90;
phiDelta = 1;
phiPitch = 360 / flute;
for g = 0:abs(phiExit - phiStart);
for k = 0:abs(phiExit - phiStart);
for j = 0:abs(phiExit - phiStart);
for m = 0:abs(phiExit - phiStart);
for i = 0:abs(phiExit - phiStart);
answerA = phiStart + i * phiDelta;
phi(i+1) = answerA;
end
answerA = phiStart + m * phiDelta;
phi(m + phiPitch) = answerA;
end
answerA = phiStart + j * phiDelta;
phi(j + 2 * phiPitch) = answerA;
end
answerA = phiStart + k * phiDelta;
phi(k + 3 * phiPitch) = answerA;
end
answerA = phiStart + g * phiDelta;
phi(g + 4 * phiPitch) = answerA;
end
b = (phi > 0); % dummy matrix for edge cofficients
h = feedRate * sin(phi / 180 * pi);
答案 0 :(得分:0)
很抱歉,如果这没有意义(只是想提供帮助),我甚至不知道它是用什么语言编写的,但我在原始代码中读到的内容指的是
for i = 0:abs(phiExit - phiStart);
answerA = phiStart + i * phiDelta;
for j = 0:abs(flute - 1)
phi(i + j * phiPitch) = answerA;
end
end