www.gusucode.com > robotics 案例源码程序 matlab代码 > robotics/InspectSampleLaserScanMessageExample.m

    %% Inspect Sample Laser Scan Message
% Load, inspect, and display a sample laser scan message.
%%
% Create sample messages and inspect the laser scan message data. |scan| is a
% sample ROS |LaserScan| message object.
exampleHelperROSLoadMessages
scan
%%
% Get ranges and angles from the object properties. Check that the ranges and angles 
% are the same size.
ranges = scan.Ranges;
angles = scan.readScanAngles;
size(ranges)
size(angles)
%%
% Display laser scan data in a figure using |plot|.
plot(scan)