Suppose I have a 2 by 60 matrix, like A = [1:60,2:61] how can I reshape it by the first 10 rows so that I can get a 20 by 6 matrix??

2 Ansichten (letzte 30 Tage)
B = reshape(A,rowSize(A)/6,[],6)

Akzeptierte Antwort

C B
C B am 12 Okt. 2021
A = [1:60;2:61]
A = 2×60
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
B = reshape(A,[20,6])
B = 20×6
1 11 21 31 41 51 2 12 22 32 42 52 2 12 22 32 42 52 3 13 23 33 43 53 3 13 23 33 43 53 4 14 24 34 44 54 4 14 24 34 44 54 5 15 25 35 45 55 5 15 25 35 45 55 6 16 26 36 46 56

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB Coder finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by