メインコンテンツ

numsides

R2026b

polyshape の辺の数を求める

説明

N = numsides(polyin) は、polyshape オブジェクトの辺の数を返します。

例

N = numsides(polyin,I) は、polyin の I 番目の境界にある辺の数を返します。

この構文は、polyin がスカラーの polyshape オブジェクトである場合のみサポートされます。

例

すべて折りたたむ

多角形を作成し、辺の数を判別します。

t = 0:0.5:2*pi;
P = [cos(t)' sin(t)'];
polyin = polyshape(P);
plot(polyin)

Filled polygon approximating a circle, created from points sampled at intervals of 0.5 radians

N = numsides(polyin)
N = 
13

入力引数

すべて折りたたむ

入力 polyshape。スカラー、ベクトル、行列または多次元配列として指定します。

データ型: polyshape

境界インデックス。スカラー整数または整数のベクトルとして指定します。I の各要素は、入力 polyshape の 1 つの境界に対応します。

データ型: double | single | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

拡張機能

すべて展開する

バージョン履歴

R2017b で導入