Draw Rectangle in MATLAB Last Updated : 28 Apr, 2025 Comments Improve Suggest changes Like Article Like Report MATLAB is a high-performance language that is used for matrix manipulation, performing technical computations, graph plottings, etc. It stands for Matrix Laboratory. In MATLAB, we can draw a rectangle by just using the built-in 'rectangle' function which takes arguments as its left bottom vertex's position and length and breadth. Syntax: rectangle('Position', [x_start, y_start, length, breadth]); where x_start and y_start are x and y coordinates respectively of the left bottom vertex of the rectangle. Suppose we are drawing a rectangle whose left bottom vertex is (2,3) and length = 5, breadth = 7. Example 1: Matlab % MATLAB code for rectangle draw rectangle('Position',[2,3,5,7]); axis([0,12,0,12]); Output: Explanation: We are passing the left bottom vertex = (2,3) and length = 5, breadth = 7 to the rectangle function. In the second line of code, we are drawing x coordinates from 0 to 12 and y coordinates from 0 to 12. Now take another example for drawing a rectangle whose left bottom vertex is (0,0) and length = 7, breadth = 7. Example 2: Matlab % MATLAB code for draw rectangle rectangle('Position',[0,0,7,7]); axis([0,10,0,10]); Output: Comment More infoAdvertise with us Next Article 3D Plots in MATLAB A akashish__ Follow Improve Article Tags : Software Engineering Technical Scripter 2022 MATLAB-Maths Similar Reads GUI Based Tables in MATLAB GUI tables in MATLAB are graphical user interface that allow users to display and manipulate tabular data.They are used to create interactive applications that require data to be displayed in a table format. GUI tables in MATLAB typically consist of columns and rows , with each column representing a 3 min read 3D Plots in MATLAB In MATLAB, we can plot different types of modules like 2d plotting and 3d plotting. In this article, we will see what are the various types of 3D plotting. Mesh Plot: A mesh plot is a 3d surface that creates different types of meshes for different types of expression. To create mesh we have to give 3 min read 2D Line Plot in MATLAB '2D' stands for 2-dimensional and a 2D line is a line that is moved in 2-dimensions. A line in 2D means that we could move in forward and backward direction but also in any direction like left, right, up, down. In MATLAB we have a function named plot() which allows us to plot a line in 2 directions. 4 min read Scatter Plot in MATLAB Scatter Plot is a popular type of graph plot that plots pairs of coordinate points discretely rather than continuously. These plots are extensively used in various industries such as the data science industry because of their statistical importance in visualizing vast datasets. Scatter Plots in MAT 3 min read Negative of an image in MATLAB The negative of an image is achieved by replacing the intensity 'i' in the original image by 'i-1', i.e. the darkest pixels will become the brightest and the brightest pixels will become the darkest. Image negative is produced by subtracting each pixel from the maximum intensity value. For example i 2 min read Create Polar Axes in MATLAB Polar Axes/Coordinate system is a type of coordinate system which rather than using the traditional cartesian axes with X and Y axes uses polar coordinates, which consists of a magnitude vector (r) and its corresponding angle (\theta    ). The conversion from polar to cartesian coordinate is simple 3 min read Like