Main Content




removeUnit(unit) removes the symbolic unit unit. You can remove only user-defined units created with newUnit. You cannot remove predefined units. If unit is a vector, removeUnit removes all units in unit.


collapse all

Remove units you define by using removeUnit. Create the unit warp3, use the unit in calculations, and then remove the unit.

Define the unit warp3 as 3 times the speed of light.

u = symunit;
warp3 = newUnit('warp3',3*u.c_0)
warp3 =

Convert 1e10 meter per second to u.warp3.

speed = rewrite(1e10*u.m/u.s,u.warp3)
speed =

After calculations, remove the unit u.warp3 by using removeUnit.


Conversion to u.warp3 now throws an error.

Input Arguments

collapse all

Unit name, specified as a symbolic unit or a vector of symbolic units.

Version History

Introduced in R2017b