MATLAB: How to store text printed to console

consoleprinttext processingvariables

The following code
>>system('WMIC CPU Get NumberOfLogicalProcessors')
prints
NumberOfLogicalProcessors
8
How can I store this number (8) in a variable?

Best Answer

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