How to store text printed to console?

4 次查看(过去 30 天)
The following code
>>system('WMIC CPU Get NumberOfLogicalProcessors')
prints
NumberOfLogicalProcessors
8
How can I store this number (8) in a variable?

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by