add character cells arrays

3 visualizaciones (últimos 30 días)
best16 programmer
best16 programmer el 22 de Nov. de 2016
Respondida: Walter Roberson el 23 de Nov. de 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].

Respuestas (1)

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

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by