以下命令
@offers = Matrix[]
allotment_matrix = Matrix[@proposal, @facility, @price.to_i, @keywords]
@offers = @offers.vstack(allotment_matrix)
将数据生成为34, 40, #<BigDecimal:7fb1339a5420,'0.38E3',9(18)>, " Near train station
“`,然后处理错误:
TypeError: can't convert Fixnum into an Array (undefined method `to_ary' for 32:Fixnum
时
x = Matrix[[1, 2], [3, 4]]
y = Matrix[[5, 6], [7, 8]]
Matrix.vstack(x, y) # => Matrix[[1, 2], [3, 4], [5, 6], [7, 8]]
我无法看到如何创建矩阵