add character cells arrays

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].

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 11 月 23 日

0 投票

first = {'d', 'd', 'd', 'd'};
second = {'d', '-d', 'd', '-d'};
result = regexprep(strcat(first(:), {'+'}, second(:)), '+-', '-').' ;

カテゴリ

ヘルプ センター および File ExchangeEntering Commands についてさらに検索

製品

質問済み:

2016 年 11 月 22 日

回答済み:

2016 年 11 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by