I need to separate text from value
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I need to separate the output of fscanf
current_amp =
:MEASUREMENT:IMMED:VALUE 35.0E-12
and only retain the number.
I would like to have the output only give me 35.0E-12.
I looked into using regexp, but it also separates the number to 35 12.
If anyone has any advice it would be greatly appreciated.
Best
Umar
0 commentaires
Réponses (1)
Jos (10584)
le 1 Mar 2016
str = ':MEASUREMENT:IMMED:VALUE 35.0E-12'
value = sscanf(str,'%*s %f')
4 commentaires
Voir également
Catégories
En savoir plus sur Characters and Strings dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!