このページの翻訳は最新ではありません。ここをクリックして、英語の最新版を参照してください。
values
説明
例
ディクショナリの値のクエリ
数値を string にマッピングする 3 つのキーと値のペアを含むディクショナリを作成します。
names = ["Unicycle" "Bicycle" "Tricycle"]; wheels = [1 2 3]; d = dictionary(wheels,names)
d = dictionary (double ⟼ string) with 3 entries: 1 ⟼ "Unicycle" 2 ⟼ "Bicycle" 3 ⟼ "Tricycle"
values
を使用して、ディクショナリに格納されている値を含む配列を返します。
v = values(d)
v = 3x1 string
"Unicycle"
"Bicycle"
"Tricycle"
ディクショナリの値を cell 配列として返す
数値を string にマッピングする 3 つのキーと値のペアを含むディクショナリを作成します。
names = ["Unicycle" "Bicycle" "Tricyle"]; wheels = [1 2 3]; d = dictionary(wheels,names)
d = dictionary (double ⟼ string) with 3 entries: 1 ⟼ "Unicycle" 2 ⟼ "Bicycle" 3 ⟼ "Tricyle"
values
を使用して、ディクショナリに格納されている値を含む配列を cell 配列として返します。
v = values(d,"cell")
v=3×1 cell array
{["Unicycle"]}
{["Bicycle" ]}
{["Tricyle" ]}
入力引数
d
— ディクショナリ
dictionary
オブジェクト
ディクショナリ。dictionary
オブジェクトとして指定します。d
が未設定の場合、values
はエラーをスローします。
バージョン履歴
R2022b で導入
参考
dictionary
| entries
| keys
| types
| numEntries
| isConfigured
| isKey
| keyHash
| keyMatch
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)