I have a column with housenumbers. Like:
str = ["54","33", "104A",...]
I want to split it in two columns
Numbers = ["54","33", "104",...]
Letters = ["","", "A",...]

댓글 수: 1

Walter Roberson
Walter Roberson 2022년 8월 10일
https://www.mathworks.com/help/matlab/ref/extract.html

댓글을 달려면 로그인하십시오.

 채택된 답변

Stephen23
Stephen23 2022년 8월 10일

0 개 추천

str = ["54","33","104A"];
tkn = regexp(str,'^(\d+)\s*(\w*)$','tokens','once');
tkn = vertcat(tkn{:});
num = tkn(:,1)
num = 3×1 string array
"54" "33" "104"
let = tkn(:,2)
let = 3×1 string array
"" "" "A"

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Tables에 대해 자세히 알아보기

제품

릴리스

R2022a

질문:

2022년 8월 10일

답변:

2022년 8월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by