add character cells arrays

3 ビュー (過去 30 日間)
best16 programmer
best16 programmer 2016 年 11 月 22 日
回答済み: Walter Roberson 2016 年 11 月 23 日
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 日
first = {'d', 'd', 'd', 'd'};
second = {'d', '-d', 'd', '-d'};
result = regexprep(strcat(first(:), {'+'}, second(:)), '+-', '-').' ;

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by