baseUnits
単位系の基本単位
説明
baseUnits(
は、単位系 unitSystem
)unitSystem
の基本単位をシンボリック単位のベクトルで返します。返された単位は、newUnitSystem
による新しい単位系の作成に使用できます。
例
単位系の基本単位
baseUnits
を使用して、単位系の基本単位を取得します。次に基本単位を変更し、変更後の基本単位を使って新しい単位系を作成します。使用可能な単位系には SI、CGS および US が含まれます。すべての単位系については、単位系の一覧を参照してください。
SI
単位系の基本単位を取得します。
SIUnits = baseUnits('SI')
SIUnits = [ [kg], [s], [m], [A], [cd], [mol], [K]]
メモ
baseUnits
という名前の変数を定義しないでください。この変数を定義すると、関数 baseUnits
へのアクセスが妨げられます。
subs
を使用して SIUnits
を変更し、長さにキロメートルを、時刻に時間を使用する基本単位を定義します。
u = symunit; newUnits = subs(SIUnits,[u.m u.s],[u.km u.hr])
newUnits = [ [kg], [h], [km], [A], [cd], [mol], [K]]
newUnitSystem
を使用して新しい単位系を定義します。
newUnitSystem('SI_km_hr',newUnits)
ans = "SI_km_hr"
単位系の間で単位を変換する方法については、単位変換と単位系を参照してください。
入力引数
unitSystem
— 単位系の名前
string | 文字ベクトル
単位系の名前。string または文字ベクトルとして指定します。
バージョン履歴
R2017b で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)