How can I add a letter to a column of strings. For example i want all names in the column one to change to this Name T.
조회 수: 2 (최근 30일)
이전 댓글 표시
I have one column with many names. I want to add a T to every name. How can I do that?
댓글 수: 0
채택된 답변
Walter Roberson
2022년 10월 6일
%build an example table
sourceletters = 'A':'P';
FirstColumn = string( sourceletters(randi(numel(sourceletters), 5, 7)));
T = table(FirstColumn)
%now do the work
T.TBefore = "T" + T.FirstColumn;
T.TAfter = T.FirstColumn + "T";
T
댓글 수: 4
Walter Roberson
2022년 10월 6일
편집: Walter Roberson
2022년 10월 6일
String operations are described at https://www.mathworks.com/help/matlab/characters-and-strings.html
Table variable operations are described at https://www.mathworks.com/help/matlab/matlab_prog/add-and-delete-table-variables.html
Possibly you want innerjoin
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 LaTeX에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!