Reshape and Repmat neatly
Ältere Kommentare anzeigen
Hi,
Can anyone help me Reshape and Replicate columns efficiently in MATLAB, I can do it with reshape and repmat but is extremely messy and i'm sure theres a quicker and neater way.
e.g.
A = [ a b c 1 2 3 4 5 6 7 8 9; d e f 1 2 3 4 5 6 7 8 9 ]
to
B = [ a b c 1 2 3; a b c 4 5 6; a b c 7 8 9; d e f 1 2 3; d e f 4 5 6; d e f 7 8 9; ]
Thanks
2 Kommentare
Walter Roberson
am 15 Mär. 2012
Numbers and letters cannot be mixed in a numeric array.
Jan
am 15 Mär. 2012
@Simon: It would easier to create an answer, if you use a numeric matrix with unqiue values.
Antworten (1)
Sean de Wolski
am 15 Mär. 2012
1 Stimme
What is wrong with reshape and repmat? Reshape is extremely fast and some form of repmat is necessary since you want that much data at the end, i.e. you're not saving memory by avoiding rempat.
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!