Split column by text and numbers
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Dion Theunissen
am 10 Aug. 2022
Beantwortet: Stephen23
am 10 Aug. 2022
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 Kommentar
Akzeptierte Antwort
Stephen23
am 10 Aug. 2022
str = ["54","33","104A"];
tkn = regexp(str,'^(\d+)\s*(\w*)$','tokens','once');
tkn = vertcat(tkn{:});
num = tkn(:,1)
let = tkn(:,2)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!