occupancyMatrix
占有グリッドを行列に変換
説明
例
バイナリ占有マップを行列に変換
ランダムな 2 次元迷路マップを生成します。
map = mapMaze(2,MapSize=[10 10],MapResolution=1); show(map)
バイナリ占有マップを占有値行列に変換します。
occupancyMatrix(map)
ans = 10x10 logical array
1 1 1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 0 0 1
1 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 1
1 0 0 1 1 1 1 1 1 1
1 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1
入力引数
map
— 地図表現
binaryOccupancyMap
オブジェクト
地図表現。binaryOccupancyMap
オブジェクトとして指定します。このオブジェクトはロボットの環境を表現します。このオブジェクトには、障害物を true
(1
)、フリー位置を false
(0
) として示すバイナリ値の行列グリッドが格納されます。
出力引数
mat
— 占有値
行列
占有値。h 行 w 列の行列として返されます。ここで、h と w は占有グリッド オブジェクトの GridSize
プロパティの 2 つの要素で定義されます。
データ型: double
拡張機能
C/C++ コード生成
MATLAB® Coder™ を使用して C および C++ コードを生成します。
バージョン履歴
R2016b で導入
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)