This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

removeUnitSystem

Remove unit system

Syntax

removeUnitSystem(unitSystem)

Description

example

removeUnitSystem(unitSystem) removes the unit system unitSystem. You can remove only user-defined unit systems created with newUnitSystem. You cannot remove predefined unit systems listed in Unit Systems List.

Examples

collapse all

Define a unit system, use the unit system to rewrite units, and then remove the unit system by using removeUnitSystem.

Define the unit system mySystem with SI base units and the derived unit kilowatt hour.

u = symunit;
bunits = baseUnits('SI');
dunits = [u.kWh];
mySystem = newUnitSystem('mySystem',bunits,dunits)
mySystem = 
    "mySystem"

Convert 50,000 Joules to derived units of mySystem by using rewrite with the third argument 'Derived'. As expected, the result is in kilowatt hour.

rewrite(50000*u.J,mySystem,'Derived')
ans =
(1/72)*[kWh]

Remove the unit system mySystem by using removeUnitSystem.

removeUnitSystem(mySystem)

Converting units to mySystem now throws an error.

Input Arguments

collapse all

Name of the unit system, specified as a string or character vector.

Introduced in R2017b