symunit2str
Convert unit to character vector
Description
Examples
Convert Unit to Character Vector
Convert the symbolic unit u.km to a
character vector, where u = symunit.
u = symunit; unitStr = symunit2str(u.km)
unitStr =
'km'Convert Unit for Specified Toolbox
Convert symbolic units to character vectors representing
units in other toolboxes by specifying the toolbox name as the second argument
to symunit2str. The allowed toolboxes are
'Aerospace', 'SimBiology',
'Simscape', or 'Simulink'. The unit
must exist in the target toolbox to be valid.
Where u = symunit, convert u.km/(u.hour*u.s)
to a character vector representing units from Aerospace Toolbox.
u = symunit; unit = symunit2str(u.km/(u.hour*u.s),'Aerospace')
unit =
'km/h-s'Convert u.molecule/u.s to a character vector representing units
from SimBiology®.
unit = symunit2str(u.molecule/u.s,'SimBiology')
unit =
'molecule/second'Convert u.gn/u.km to a character vector representing units from
Simscape™.
unit = symunit2str(u.gn/u.km,'Simscape')
unit =
'gee/km'Convert u.rad/u.s to a character vector representing units from
Simulink®.
unit = symunit2str(u.rad/u.s,'Simulink')
unit =
'rad/s'Input Arguments
Version History
Introduced in R2017a