How to solve question 5?

Answers (1)

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

Tags

Asked:

on 28 Oct 2022

Answered:

on 28 Oct 2022

Community Treasure Hunt

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

Start Hunting!