Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在所有这些可用的运算符中有点迷失 - 那么有没有简单的方法将整个行/列(向量)插入矩阵?
我开始考虑创建一个向量,将其转换为数组,将其与转换为数组的矩阵连接起来,并基于这样的组合数组创建新的矩阵,但它看起来比听起来更难看。
val m = DenseMatrix((1, 4, 10, 13), (2, 5, 11, 14), (3, 6, 12, 15)) val v = DenseVector(7, 8, 9) val m2 = DenseMatrix.zeros[Int](3, 5) m2(::, 0 to 1) := m(::, 0 to 1) m2(::, 2) := v m2(::, 3 to 4) := m(::, 2 to 3)
您将在此处找到有关基本微风功能的更多信息。