ishole
polyshape
の境界が穴であるかどうかを判定
説明
例
多角形の穴の判別
1 つの固体領域と 1 つの穴をもつ多角形を作成し、どの領域が穴であるかを判別します。
t = 0.05:0.5:2*pi; x1 = cos(t); y1 = sin(t); x2 = 0.5*cos(t); y2 = 0.5*sin(t); polyin = polyshape({x1,x2},{y1,y2})
polyin = polyshape with properties: Vertices: [27x2 double] NumRegions: 1 NumHoles: 1
plot(polyin)
TF = ishole(polyin)
TF = 2x1 logical array
0
1
境界を 1 つずつクエリするには、境界インデックスを 2 番目の引数として使用します。
TF = ishole(polyin,2)
TF = logical
1
入力引数
polyin
— 入力 polyshape
スカラー
入力 polyshape
。スカラーとして指定します。
データ型: polyshape
I
— 境界インデックス
スカラー整数 | 整数のベクトル
境界インデックス。スカラー整数または整数のベクトルとして指定します。I
の各要素は、入力 polyshape
の 1 つの境界に対応します。
データ型: double
| single
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
拡張機能
C/C++ コード生成
MATLAB® Coder™ を使用して C および C++ コードを生成します。
使用上の注意事項および制限事項:
コード生成用に動的メモリ割り当てを有効にしなければなりません。
名前と値のペアはコンパイル時の定数でなければなりません。
バージョン履歴
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)