Main Content

unitInfo

説明

unitInfo(unit) は、シンボリック単位 unit の情報を返します。

unitInfo(dim) は次元 dim で可能な単位を返します。

unitInfo は可能な物理次元の配列を返します。

A = unitInfo(___) は、前の構文の入力引数のいずれかを使用して A に出力を返します。次元は文字列として返され、単位はシンボリック単位として返されます。

すべて折りたたむ

単位 u.Wb の情報を検索します。ここで、u = symunit です。関数 unitInfoWb が磁束の SI 単位であることを指定します。

u = symunit;
unitInfo(u.Wb)
weber - a physical unit of magnetic flux. ['SI']

Get all units for measuring 'MagneticFlux' by calling unitInfo('MagneticFlux').
SI units accept all SI prefixes. For details, see SI Unit Prefixes List.

記述のように、'MagneticFlux' に可能なすべての単位を検索します。

unitInfo('MagneticFlux')
All units of dimension 'MagneticFlux':

abWb - abweber
Mx - maxwell
phi_0 - magnetic flux quantum
statWb - statweber
Wb - weber ['SI']

Get the base SI units of any unit above by calling rewrite(<unit>,'SI').
SI units accept all SI prefixes. For details, see SI Unit Prefixes List.

unitInfo は複合単位に関する情報も返します。u.m/u.s^2 の情報を検索します。

unitInfo(u.m/u.s^2)
meter per square second - a physical unit of acceleration. ['SI']

Get all units for measuring 'Acceleration' by calling unitInfo('Acceleration').
SI units accept all SI prefixes. For details, see SI Unit Prefixes List.

unitInfo を入力引数なしで使用して、可能なすべての次元を返します。

unitInfo
"AbsorbedDose"
"AbsorbedDoseOrDoseEquivalent"
"AbsorbedDoseRate"
"Acceleration"
...
...
"Length"
"Luminance"
"LuminousEfficacy"
...
...
"Torque"
"Velocity"
"Volume"

unitInfo が返した情報を、出力提供のたびに利用するよう保存します。

u.C の次元を保存します。

u = symunit;
dimC = unitInfo(u.C)
dimC = 
    "ElectricCharge"

次元 dimC のすべての単位を検索および保存します。

unitsEC = unitInfo(dimC)
unitsEC =
   [abC]
     [C]
     [e]
    [Fr]
 [statC]

unitsEC の 3 番目の単位の情報を検索します。

unitInfo(unitsEC(3))
elementary charge - a physical unit of electric charge.

Get all units for measuring 'ElectricCharge' by calling unitInfo('ElectricCharge').

[e] を保存します。次に 1 クーロンの電荷の電子数を求めます。

electronCharge = unitsEC(3);
numElectrons = simplify(u.C/electronCharge)
numElectrons =
5000000000000000000000000000/801088317

1 クーロン内には約 6.24 x 1018 個の電子があることを、高精度のシンボリックな結果を double に変換することで示します。

numElectrons = double(numElectrons)
numElectrons =
   6.2415e+18

入力引数

すべて折りたたむ

単位の名前。シンボリック単位、文字ベクトル、または string として指定します。unit単位と単位系の一覧の既知の基本単位または組立単位でない場合、A = unitInfo(unit) は空の string "" を返します。

例: unitInfo(u.m) ここで、u = symunit

次元。文字ベクトルまたは string として指定します。

例: unitInfo('Length')

バージョン履歴

R2017b で導入