# How to remove the units in matrix?

data={{"0.00mA", "0.18V", "43.1mV"}, {"0.02mA", "0.22V", "55.9mV"}, {"0.03mA", "0.30V", "59.4mV"}, {"0.05mA", "0.33V", "63.6mV"}, {"0.05mA", "0.36V", "79.8mV"}, {"0.07mA", "0.42V", "91.5mV"}, {"0.10mA", "0.54V", "92.6mV"}, {"0.09mA", "0.60V", "91.9mV"}, {"0.00mA", "0.15V", "39.1mV"}, {"0.00mA", "0.18V", "43.1mV"}, {"0.02mA", "0.22V", "55.9mV"}, {"0.03mA", "0.30V", "59.4mV"}, {"0.05mA", "0.33V", "63.6mV"}, {"0.05mA", "0.36V", "79.8mV"}, {"0.07mA", "0.42V", "91.5mV"}, {"0.10mA", "0.54V", "92.6mV"}, {"0.09mA", "0.60V", "91.9mV"}}


I use the following code,but very slow.

Map[QuantityMagnitude@
ReleaseHold@WolframAlpha[#, {{"Input", 1}, "Input"}] &, data, {2}]


How to convert it to a matrix that only contains number?

• Is QuantityMagnitude[Map[Interpreter["Quantity"], matrix, {2}]] still too slow for your needs? May 9, 2016 at 14:06
• Good,I intend to use Interpreter["Units"], but found nothing. May 9, 2016 at 14:13

Map[First@StringCases[#, NumberString] &, data, {2}]


This code can cater my purpose.

Example:

MatrixForm @ Partition[StringDelete[Flatten @ data, LetterCharacter], 3]


Ex. time: .00010723

Output