嘿,目前我正在try 用Python语言编写一个二次规划算法. 但我正在努力创建一个矢量来指示问题的维度.
我的问题是:我正在try 创建一个包含N个元素的向量x=[x_1,x_2,x_3,...,x_N].N个变量.元素‘x_N’应该是变量/我的优化问题的解.
到目前为止我的代码是:(‘noe’...等于N+1,这就是我在While语句中减go 1的原因)
#filling the x-vector according to the dimension of the given problem
temp_2 = 0
while temp_2 <= (NoE-1):
x[temp_2]= 'x_' + temp_2
print(x)
感谢您的帮助!:)