add character cells arrays
3 views (last 30 days)
Show older comments
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].
0 Comments
Answers (1)
Walter Roberson
on 23 Nov 2016
first = {'d', 'd', 'd', 'd'};
second = {'d', '-d', 'd', '-d'};
result = regexprep(strcat(first(:), {'+'}, second(:)), '+-', '-').' ;
0 Comments
See Also
Categories
Find more on Get Started with MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!