MATLAB: Problem extracting data from dos command.

dos commandsscanf

I managed to obtain a string using
data = evalc('!netstat -s -p UDP')
However, when I tried to use sscanf, all I got was '' .
received = sscanf(data,'Datagrams Received = %d') received =
''
Did I do something wrong or did I miss a step? Or is there another method?

Best Answer

sscanf does not look through the data until it finds something that matches the format: sscanf only succeeds if the part from the beginning of the string matches the format.
I suggest you look at regexp()