Main Content

findUsages (unit, unitprefix)

Find out how a unit or unit prefix is used

Description

[componentList,usageTable] = findUsages(obj) returns a vector of components that use the unit or unit prefix object obj and a table providing details about how the obj is used in the BuiltInLibrary and UserDefinedLibrary. For details of what SimBiology® checks to decide whether a unit or unit prefix is used by another component, see Component Usage.

[componentList,usageTable] = findUsages(obj,model) also searches for usages of the obj in model, which is a SimBiology model, or a vector of model objects.

[componentList,usageTable] = findUsages(obj,model,dose) also searches for usages of the obj in dose, which is a ScheduleDose object, RepeatDose object, or a vector of dose objects.

Input Arguments

collapse all

Unit or unit prefix, specified as a Unit object, or UnitPrefix object

SimBiology model, specified as a Model object or vector of model objects.

Dose object, specified as a ScheduleDose object, RepeatDose object, or vector of dose objects.

Output Arguments

collapse all

List of model components that use the unit or unit prefix, returned as a vector.

Usage information, returned as a table. Table variables are:

Examples

collapse all

Create the unit object.

gram = sbioselect('Type','Unit','Name','gram');

Check and see how the gram unit is used in the built-in library. If you have a custom library, the function also searches it.

gramUsage = findUsages(gram)
gramUsage = 
   SimBiology Unit Array

   Index:    Library:    Name:      Composition:                              Multiplier:    Offset:
   1         BuiltIn     gram       gram                                      1              0      
   2         BuiltIn     joule      (meter^2*kilogram)/second^2               1              0      
   3         BuiltIn     calorie    (meter^2*kilogram)/second^2               4.1868         0      
   4         BuiltIn     pascal     kilogram/(meter*second^2)                 1              0      
   5         BuiltIn     watt       (kilogram*meter^2)/second^3               1              0      
   6         BuiltIn     newton     (kilogram*meter)/second^2                 1              0      
   7         BuiltIn     dyne       (gram*centimeter)/second^2                1              0      
   8         BuiltIn     volt       (kilogram*meter^2)/(ampere*second^3)      1              0      
   9         BuiltIn     farad      (ampere^2*second^4)/(kilogram*meter^2)    1              0      
   10        BuiltIn     ohm        (kilogram*meter^2)/(ampere^2*second^3)    1              0      
   11        BuiltIn     siemens    (ampere^2*second^3)/(kilogram*meter^2)    1              0      
   12        BuiltIn     weber      (kilogram*meter^2)/(ampere*second^2)      1              0      
   13        BuiltIn     tesla      kilogram/(second^2*ampere)                1              0      
   14        BuiltIn     henry      (kilogram*meter^2)/(ampere^2*second^2)    1              0      

Introduced in R2016b