MATLAB: Remove units from a string

MATLABmatlab gui

Hello all,
I would like to remove the units (for e.g. seconds) from a string and convert it to double.
For e.g.: 1.00s to 1.00 or 1.25ns to 1.25
Is there any simple way to do that?
Thanks.

Best Answer

s = '1.25ns';
v = sscanf(s, '%f')