Main Content

patch

Draw colored shape on block mask icon

    Description

    patch(x,y) draws a solid shape specified by the coordinate vectors x and y. The color of the shape is the current foreground color.

    patch(x,y,rgb) draws a shape with the color specified by the vector rgb.

    example

    Examples

    collapse all

    Use this command to create a red triangle on the block mask icon.

    patch([0 0.5 1], [0 1 0], [1 0 0])
    

    Simulink block showing a red triangle on the block icon

    Input Arguments

    collapse all

    x-coordinates of the shape, specified as a vector.

    Example: patch([0 0.5 1], [0 1 0], [1 0 0])

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | categorical | datetime | duration

    y-coordinates of the shape, specified as a vector.

    Example: patch([0 0.5 1], [0 1 0], [1 0 0])

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | categorical | datetime | duration

    RGB triplet, specified as a three-element row vector whose elements represent the intensities of the red, green, and blue components of the color of the shape. The intensities must be in the range [0,1].

    Example: [0.4 0.6 0.7]

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | categorical | datetime | duration

    Version History

    Introduced in R2006a

    See Also

    | | |