ヘルプ センターヘルプ センター
Map オブジェクトのサイズ
Map
n = size(M,1)
szdim = size(M,dim)
sz = size(M)
[sz1,sz2,...,szL] = size(M)
例
n = size(M,1) は、入力 Map オブジェクトのキーと値のペアの数を返します。size(M,1) は length(M) およびプロパティ M.Count と等価です。
M
size(M,1)
length(M)
M.Count
szdim = size(M,dim) は、次元 dim の長さを返します。Map オブジェクトはデータを n 行 1 列のキーと値のペアのセットに格納するため、dim > 1 の場合、size は 1 を返します。
dim
n
1
dim > 1
size
sz = size(M) は、2 要素ベクトル [n 1] を返します。ここで、n は M のキーと値のペアの数です。
[n 1]
[sz1,sz2,...,szL] = size(M) は [n,1,...,1] を返します。
[n,1,...,1]
すべて折りたたむ
Map オブジェクトを作成します。
months = {'Jan','Feb','Mar','Apr'}; rainfall = [327.2 368.2 197.6 178.4]; M = containers.Map(months,rainfall)
M = Map with properties: Count: 4 KeyType: char ValueType: double
キーと値のペアの数を返します。
n = 4
ペアの数をベクトルとして返します。
sz = 1×2 4 1
入力 Map オブジェクト。
クエリする次元。正の数値スカラーとして指定します。
containers.Map | isKey | keys | length | values
containers.Map
isKey
keys
length
values
この例の変更されたバージョンがあります。編集された方の例を開きますか?
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
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:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office