在OCTAVE中将矩阵A的第一、四、五行、一、五列做成矩阵B
Make a matrix B of the first, fourth and fifth row and the first and fifth column from matrix A in OCTAVE
我有矩阵A
一个=
5 10 15 20 25
10 9 8 7 6
-5 -15 -25 -35 -45
1 2 3 4 5
28 91 154 217 280
我需要从矩阵A的第一行、第四行和第五行以及第一列和第五列创建一个矩阵B。
我该怎么做?
>> B = A([1,4,5],[1,5])
B =
5 25
1 5
28 280
您应该了解如何使用 Matlab 和 Octave 语言中的索引表达式来提取和处理子矩阵。
请参阅有关索引表达式的 Octave 帮助:https://octave.org/doc/latest/Index-Expressions.html
我有矩阵A 一个=
5 10 15 20 25
10 9 8 7 6
-5 -15 -25 -35 -45
1 2 3 4 5
28 91 154 217 280
我需要从矩阵A的第一行、第四行和第五行以及第一列和第五列创建一个矩阵B。 我该怎么做?
>> B = A([1,4,5],[1,5])
B =
5 25
1 5
28 280
您应该了解如何使用 Matlab 和 Octave 语言中的索引表达式来提取和处理子矩阵。
请参阅有关索引表达式的 Octave 帮助:https://octave.org/doc/latest/Index-Expressions.html