我正在尝试计算x1^i * x2^j * x3^k * ......
到目前为止,这是我的代码:
for l = 1:N
f = 1;
for i = 0:2
for j = 0:2-i
for k = 0:2-j
for m = 0:2-k
g(l,f) = x1(l)^i*x2(l)^j*x3(l)^k*x4(l)^m;
f = f+1;
end
end
end
end
end
我怎样才能更容易或没有循环?