如何对 Octave 中的特定行执行元素明智的添加?

How to perform element wise addition to a particular row in Octave?

我有两个矩阵

A = [0 0 0; 0 0 0; 0 0 0]

B = [2 3 4;]

我将如何获得

A = [0 0 0; 2 3 4; 0 0 0]

在 Octave 中,您可以 set/update 原始矩阵的任何部分。

例如,这里是如何将向量 B 添加到矩阵 A 的第二行:

A(2,:) = A(2,:) + B;