Extract number on variable name.
Mostra commenti meno recenti
Risposte (2)
Azzi Abdelmalek
il 19 Lug 2016
Modificato: Azzi Abdelmalek
il 19 Lug 2016
s='Final_50000_run_1'
regexp(s,'\d+','match','once')
If you want to extract all the numbers
regexp(s,'\d+','match')
Steven Lord
il 19 Lug 2016
1 voto
Is this a variable name or a file name? If it is a variable name, I recommend you read question 1 in the Programming section of the FAQ for an explanation of why including data in your variable names is discouraged. If it is a file name, see Azzi's answer.
Categorie
Scopri di più su Fortran with MATLAB in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!