Extracting the numeric part from a cell
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Mahdi Khademishamami
il 17 Nov 2021
Commentato: Mahdi Khademishamami
il 17 Nov 2021
Hi everyone,
I have a column string in this format
"injection-0:94577)"
"injection-0:94578)"
"injection-0:94579)"
"injection-0:94580)"
"injection-0:94581)"
"injection-0:94582)"
"injection-0:94583)"
I want to extract the numeric part that starts with 9 like 94577 from roow one for instance. Can anyone help please? Thank you.
0 Commenti
Risposta accettata
Paul
il 17 Nov 2021
str = ["injection-0:94577)"
"injection-0:94578)"
"injection-0:94579)"
"injection-0:94580)"
"injection-0:94581)"
"injection-0:94582)"
"injection-0:94583)"]
newstr = extractBefore(extractAfter(str,":"),")")
3 Commenti
Paul
il 17 Nov 2021
I would just use double()
str = ["injection-0:94577)"
"injection-0:94578)"
"injection-0:94579)"
"injection-0:94580)"
"injection-0:94581)"
"injection-0:94582)"
"injection-0:94583)"];
newstr = extractBefore(extractAfter(str,":"),")");
d = double(newstr)
Più risposte (1)
Vedere anche
Categorie
Scopri di più su Characters and Strings in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!