Complex nested loops- matrix indexing

I have a 20x20 matrix, I need to move some elements from a starting index i.e. (6, 3) to an ending index i.e. (17,2) to a new 12x2 matrix in this case.

Antworten (1)

Bruno Luong
Bruno Luong am 31 Jul. 2020

0 Stimmen

A=randi(10,20,20) % some tes matrix, replace it with yours
B = A(6:1:17, 3:-1:2)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 31 Jul. 2020

Beantwortet:

am 31 Jul. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by