findCategory
ラベルのプロジェクト カテゴリの検索
説明
は指定した名前で指定したプロジェクトからカテゴリを取得します。関数 category
= findCategory(proj
,categoryName
)addLabel
または関数 removeLabel
を使用する前に、カテゴリを取得する必要があります。
例
プロジェクト ラベルのカテゴリを取得する
プロジェクト Times Table App を開きます。currentProject
を使用して、現在読み込まれているプロジェクトからプロジェクト オブジェクトを作成します。
openExample("matlab/TimesTableProjectExample")
proj = currentProject;
名前を指定してラベルのカテゴリを取得するには、関数 findCategory
を使用します。
category = findCategory(proj,"Classification")
category = Category with properties: Name: "Classification" SingleValued: 1 DataType: "none" LabelDefinitions: [1×7 matlab.project.LabelDefinition]
または、インデックスでカテゴリを取得することもできます。1 番目のカテゴリを取得します。
proj.Categories(1)
ans = Category with properties: Name: "Classification" SingleValued: 1 DataType: "none" LabelDefinitions: [1×7 matlab.project.LabelDefinition]
カテゴリで何ができるか調べます。
methods(category)
Methods for class matlab.project.Category: createLabel findLabel removeLabel
入力引数
proj
— プロジェクト
matlab.project.Project
オブジェクト
プロジェクト。matlab.project.Project
オブジェクトとして指定します。currentProject
を使用して、現在読み込まれているプロジェクトからプロジェクト オブジェクトを作成します。
categoryName
— カテゴリ名
文字ベクトル | string スカラー
取得するカテゴリの名前。文字ベクトルまたは string スカラーとして指定します。
出力引数
category
— ラベルのカテゴリ
Category
オブジェクト
ラベルのカテゴリはクエリまたは変更可能な Category
オブジェクトとして返されます。指定したカテゴリが見つからない場合、この関数は空の配列を返します。
バージョン履歴
R2019a で導入
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)