keys
설명
예제
사전의 키 쿼리하기
숫자를 문자열에 매핑하는 세 개의 키-값 쌍을 포함하는 사전을 만듭니다.
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"
keys
를 사용하여, 사전에 저장된 키를 포함하는 배열을 반환합니다.
k = keys(d)
k = 3×1
1
2
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"
keys
를 선택적 입력값 "cell"
과 함께 사용하여, 사전에 저장된 키를 포함하는 배열을 셀형 배열로 반환합니다.
k = keys(d,"cell")
k=3×1 cell array
{[1]}
{[2]}
{[3]}
입력 인수
d
— 사전
dictionary
객체
사전으로, dictionary
객체로 지정됩니다. d
가 구성되지 않은 경우 keys
는 오류를 발생시킵니다.
버전 내역
R2022b에 개발됨
참고 항목
dictionary
| entries
| values
| types
| numEntries
| isConfigured
| isKey
| keyHash
| keyMatch
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 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)