转换成matlab语言 double ucount = 0, pro = 0.001; for (int i = 0; i <= (int)(1.0 / pro); i++) { u.push_back(ucount); ucount += pro; //myfile << u[i] << std::endl; } //printf("11111111111111111111\n"); int n = u.size(); int m = row; double arcs; //printf("n= %d\n", n); s_m.push_back(0); for (int i = 0; i < n - 1; i++) { arcs = ComputeArcLengthOfBspline(row, P_X, P_Y, P_Z, U, u[i], u[i + 1]); //计算样条曲线弧长 s_m.push_back(s_m[i] + arcs); } //printf("2222222222222222222222222\n"); double St = s_m[n - 1]; //printf("St= %f\n", St); for (int i = 0; i < (int)s_m.size(); i++) { s.push_back(s_m[i] / St); //myfile << s[i] << std::endl; }
时间: 2024-04-19 14:28:53 浏览: 168
matlab 进制转换
ucount = 0;
pro = 0.001;
for i = 0 : floor(1/pro)
ucount = ucount + pro;
u = [u ucount];
end
n = length(u);
m = row;
arcs = 0;
s_m = [0];
for i = 1 : n - 1
arcs = ComputeArcLengthOfBspline(row, P_X, P_Y, P_Z, U, u(i), u(i + 1)); %计算样条曲线弧长
s_m = [s_m s_m(i) + arcs];
end
St = s_m(end);
s = [];
for i = 1 : length(s_m)
s = [s s_m(i) / St];
end
阅读全文