Split column in table based on character
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I have a table with a string column. Now i want to split this column in 3 seperate coluns.
In that column are strings like this:
["51∞ 13' 51,6""]
I want to create new columns like:
[51],[13], [51.6]
Anyone who can help me with this?
댓글 수: 0
채택된 답변
Walter Roberson
2021년 8월 3일
S = "51∞ 13' 51,6"""
str2double(regexp(regexprep(S, ',', '.'),'[\d.]+', 'match'))
Is it possible for + or - to appear? How is N vs S or E vs W denoted?
댓글 수: 3
Walter Roberson
2021년 8월 3일
S = [
"51∞ 14' 12,9"""
"51∞ 8' 40,2"""
"51∞ 16' 43,3"""
"51∞ 8' 40,3"""
]
cell2mat(cellfun(@str2double,regexp(regexprep(S, ',', '.'),'[\d.]+', 'match'), 'uniform', 0))
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!