Filter löschen
Filter löschen

Access different elements of matrix

2 Ansichten (letzte 30 Tage)
Gina Carts
Gina Carts am 19 Feb. 2019
Beantwortet: Adam am 19 Feb. 2019
I have a 4D matrix with dimensions A = [100,100,25, 9].
I want to create another matrix including only the 2,3,4,5 and 7th elements of the 4th dimension.
If I want the 2nd till the 5th I know B = A[:,:,:,2:5]. If I want to add the 7th as well how can I add it?

Akzeptierte Antwort

Adam
Adam am 19 Feb. 2019
B = A( :, :, :, [2:5, 7] );

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by