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
2016년 11월 23일
first = {'d', 'd', 'd', 'd'};
second = {'d', '-d', 'd', '-d'};
result = regexprep(strcat(first(:), {'+'}, second(:)), '+-', '-').' ;
카테고리
도움말 센터 및 File Exchange에서 Entering Commands에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!