Reshape and Repmat neatly
Show older comments
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 Comments
Walter Roberson
on 15 Mar 2012
Numbers and letters cannot be mixed in a numeric array.
Jan
on 15 Mar 2012
@Simon: It would easier to create an answer, if you use a numeric matrix with unqiue values.
Answers (1)
Sean de Wolski
on 15 Mar 2012
1 vote
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.
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!