add character cells arrays

4 visualizzazioni (ultimi 30 giorni)
best16 programmer
best16 programmer il 22 Nov 2016
Risposto: Walter Roberson il 23 Nov 2016
we have a character cell [d d d d] and [d -d d -d]. how can we get [d+d d-d d+d d-d].

Risposte (1)

Walter Roberson
Walter Roberson il 23 Nov 2016
first = {'d', 'd', 'd', 'd'};
second = {'d', '-d', 'd', '-d'};
result = regexprep(strcat(first(:), {'+'}, second(:)), '+-', '-').' ;

Categorie

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

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by