How to horizontally merge cells of strings/chars for each row without writing a for-loop?

1 visualizzazione (ultimi 30 giorni)
I have some m*n cells of char arrays, and the figure serves as an example for that. Is it possible to horizontally merge char arrays of each rows like 'B659' and 'Z01' to 'B659Z01' without using a for-loop to iterate each row?

Risposta accettata

Walter Roberson
Walter Roberson il 21 Nov 2022
fmt = repmat('%s', 1, size(YourCell,2));
output = compose(fmt, string(YourCell));

Più risposte (0)

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by