How to duplicate columns in a cell array based on different values in last row
Ältere Kommentare anzeigen
If I have a 4x2 cell array, D, which is equal to the following...
'2' '2'
'01346' '01347'
'P' 'P'
'62 63 71' '64 66'
How do I repeat the columns and split up the last row of the columns, like so...
'2' '2' '2' '2' '2'
'01346' '01346' '01346' '01347' '01347'
'P' 'P' 'P' 'P' 'P'
'62' '63' '71' '64' '66'
Any help and input would be helpful and greatly appreciated. I haven't written any specific code, but I was thinking along the lines of splitting the string of the last cells first and then trying to duplicate the columns, but I was unsure of how exactly to proceed. Thank you!
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Multidimensional Arrays 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!