Borrar filtros
Borrar filtros

How to store text printed to console?

4 visualizaciones (últimos 30 días)
Abdul Basith Ashraf
Abdul Basith Ashraf el 11 de Nov. de 2019
Respondida: JESUS DAVID ARIZA ROYETH el 11 de Nov. de 2019
The following code
>>system('WMIC CPU Get NumberOfLogicalProcessors')
prints
NumberOfLogicalProcessors
8
How can I store this number (8) in a variable?

Respuesta aceptada

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH el 11 de Nov. de 2019
solution:
[status,result]=system('WMIC CPU Get NumberOfLogicalProcessors');
number = str2double(regexp(result, '\d+', 'match'))

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB 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!

Translated by