Matlab/ GNU octave 语法

Matlab/ GNU octave syntax

我需要理解用这些语言编写的 GMRES algorithm 的一部分。使我成为问题的是以下内容:

y = H(1:k,1:k) \ beta(1:k);
x = x + Q(:,1:k)*y; 

谁能解释一下它的扩展形式是什么意思。

提前致谢。

关于第一个方程的内容:

H(1:k,1:k) = sub-matrix of matrix H that you obtain by taking rows from 1 (beginning) to k and columns from 1 (beginning) to k
beta(1:k) = sub-vector of vector beta that you obtain by taking elements from 1 (beginning) to k
y = is a matrix obtained by solving a symbolic matrix left division between sub-matrix of H and the sub-vector of beta

关于第二个方程的内容:

Q(:,1:k) = sub-matrix of matrix Q with all the rows and columns from 1 (beginning) to k
x = a matrix that is obtained by adding to it's previous value the result of the multiplication between the sub-matrix of matrix Q and y

Matlab 中的索引是从 1 开始的,而不是从 0 开始的。因此,索引 1 对应于您正在使用的任何内容的第一个元素。索引子矩阵示例:

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

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

B is then equal to:

[
  2 3;
  1 2
];

C = A(:,1:2);

C is then equal to:

[
  2 3;
  1 2;
  3 4
];

那个奇怪的除法符号表示矩阵左除(更多信息:mathworks.com/help/symbolic/mldivide.html):X = A\B以矩阵形式求解线性方程组的符号系统: A*X = B 对于 X