if i have matrix of 20X2048 and i want to make it 20000X2048 how to do it
Ältere Kommentare anzeigen
matrix size = 20 x 2048
new matrix size =20000 x 2048
Antworten (1)
help repmat
3 Kommentare
ANUSAYA SWAIN
am 4 Nov. 2022
Walter Roberson
am 4 Nov. 2022
NewMatrix = repmat(Matrix, 20000/size(Matrix,1), 1)
or
NewMatrix = repelem(Matrix, 20000/size(Matrix,1), 1)
The difference is whether you want to repeat the first element 1000 times, then the second element 1000 times, and so on (if so, repelem), or if you want to repeat have all 20 values in order, followed by the same 20 in order, then again and again and again 1000 times
Stephen23
am 4 Nov. 2022
"but this will also change the column dmension."
Only if you tell it to. If you specify the column replication as 1, then the number of columns won't change.
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!