回答 (1 件)

Walter Roberson
Walter Roberson 2022 年 10 月 28 日

0 投票

Example:
YourMatrix = magic(5)
YourMatrix = 5×5
17 24 1 8 15 23 5 7 14 16 4 6 13 20 22 10 12 19 21 3 11 18 25 2 9
SomeVariable = YourMatrix(1, 4:5) %copy last 2 elements of the first row
SomeVariable = 1×2
8 15
SomeOtherVariable = YourMatrix(3, [2 4]) %copy 2nd and 4th elements of the third row
SomeOtherVariable = 1×2
6 20

カテゴリ

タグ

質問済み:

2022 年 10 月 28 日

回答済み:

2022 年 10 月 28 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by