plot
Description
plot(
plots a bird's-eye view of a
parking space. Use this plot to examine the dimensions, angle, color, and type of a parking
space before adding it to a parking lot.space
)
plot(
sets the visibility of the parking space origin to space
,Origin=visibility
)"on"
or
"off"
.
Examples
Create Parking Lot Using Predefined Layout
Explore the various parking lots that you can create by using predefined layouts as well as the options for configuring those layouts.
Define the parking space used to populate the parking lot. Modify the width, length, or angle of the space and the width and strength of its lane markings. Plot the parking space.
width = 2.6; % m length = 5.5; % m angle = 90; % deg markingWidth = 0.15; markingStrength = 1; space = parkingSpace(Width=width, ... Length=length, ... Angle=angle, ... MarkingWidth=markingWidth, ... MarkingStrength=markingStrength); plot(space)
Create a driving scenario containing a 50-by-50 meter parking lot. Specify a predefined parking lot layout and a minimum driving lane width. The generated parking lot fills with as many parking spaces that fit the layout as possible given the minimum driving lane width constraint. Modify the parking space, layout type, and driving lane width, and observe the effects on the parking lot. For example:
As you increase the size of the parking space or the minimum driving lane width, the number of parking grids that fit in the middle of the parking lot decreases.
If you select the
HorizontalWithEdges
orVerticalWithEdges
layout, one edge has fewer spaces than the others. This edge contains a driving lane of widthDrivingLaneWidth
that enables vehicles to enter the parking lot.
scenario = drivingScenario; vertices = [0 0; 50 0; 50 -50; 0 -50]; parkingLayout = "Vertical"; drivingLaneWidth = 2.6; % m parkingLot(scenario,vertices, ... ParkingSpace=space, ... ParkingLayout=parkingLayout, ... DrivingLaneWidth=drivingLaneWidth); plot(scenario)
Create Parking Lot Containing Multiple Space Types
Create a parking lot that contains a mixture of parking spaces, no-parking areas, and accessible spaces.
Define the parking space to use in the parking lot. Use the default settings. Plot the space.
space = parkingSpace;
plot(space,Origin="off")
Define the no-parking areas to use in the parking lot. Specify a color of white and a width that is one meter less than the width of the default parking space. Plot the space.
noSpace = parkingSpace(Type="NoParking",Width=(space.Width - 1),MarkingColor="White"); plot(noSpace,Origin="off")
Define the accessible parking space to use in the parking lot. Specify a width that is one meter more than the width of the default parking space. Plot the space.
accessibleSpace = parkingSpace(Type="Accessible",Width=(space.Width + 1)); plot(accessibleSpace,Origin="off")
Create a driving scenario containing a parking lot with a nonrectangular layout. Plot the parking lot and display the edge numbers along which you can add parking spaces.
scenario = drivingScenario;
vertices = [0 0; 32 -10.5; 32 -50.5; 25 -57.5; 0 -57.5];
lot = parkingLot(scenario,vertices);
plot(scenario,ParkingLotEdges="on")
Insert default parking spaces along the first three edges of the parking lot. To avoid overlapping parking spaces, make these adjustments to the insertions:
Along edge 1, insert only 10 spaces.
Along edge 2, offset the spaces by 5 meters from the first vertex of the edge.
Along edge 3, offset the spaces by 3 meters from the first vertex of the edge.
numSpaces = 10; insertParkingSpaces(lot,space,numSpaces,Edge=1) insertParkingSpaces(lot,space,Edge=2,Offset=5) insertParkingSpaces(lot,space,Edge=3,Offset=3)
In the center of the parking lot, insert a 2-by-10 grid of parking spaces containing 8 columns of default spaces, 1 column of no-parking areas, and 1 column of accessible spaces.
insertParkingSpaces(lot,[space noSpace accessibleSpace],[8 1 1],Position=[12 -18],Rows=2)
Input Arguments
space
— Parking space
parkingSpace
object
Parking space, specified as a parkingSpace
object.
visibility
— Visibility of parking space origin
"on"
(default) | "off"
Visibility of parking space origin, specified as "on"
or
"off"
. The origin is located on the upper-left corner of the
parking space.
Data Types: char
| string
Version History
Introduced in R2021b
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)