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
속성에 있는 두 요소에 의해 정의됩니다.
데이터형: double
확장 기능
C/C++ 코드 생성
MATLAB® Coder™를 사용하여 C 코드나 C++ 코드를 생성할 수 있습니다.
버전 내역
R2016b에 개발됨
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)