Get number from a string
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
GN3R8
el 10 de Jun. de 2022
Comentada: GN3R8
el 10 de Jun. de 2022
How do I get -0.966 from the string B as a number
B = α -0.966 ° OK 4.000 -15.000 ° 23.000 ° Freiwinkel
I'm missing the minus when I do this:
out_all= regexp(B, '\w*\d', 'Match');
out_all = out_all{1,1};
Radius = append(out_all{1},'.',out_all{2});
0 comentarios
Respuesta aceptada
Stephen23
el 10 de Jun. de 2022
B = 'α -0.966 ° OK 4.000 -15.000 ° 23.000 ° Freiwinkel'
C = regexp(B,'[-+]?\d+\.?\d*', 'match')
V = str2double(C)
Más respuestas (0)
Ver también
Categorías
Más información sobre Signal Processing Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!