范德蒙德python3矩阵

时间:2018-07-04 01:30:08

标签: python-3.x

我写了一个代码来计算vandermonde矩阵,但是我不能以矩阵形式打印它。非常感谢您的帮助。我的代码附在下面。

x = [0.55,0.60,0.65,0.70,0.75,0.80,0.85,0.90,0.95,1.00]
col = 10
row = 10
matrix = [[0 for x in range(col)]for y in range(row)]
for i in (range(row)):
    matrix[i][0] = 1;
for i in (range(row)):
    for j in (1,2,3):
        matrix[i][j] = matrix[i][j-1] * x[i]
for i in (range(row)):
    for j in (range(col)):
        print(matrix[i][j], end = "")
        A = ("\n")
    print(A)

0 个答案:

没有答案