Table of Contents
Delete a single row in matlab
In this article I will show simple examples to show how to delete a row in MATLAB? If we have a matrix of large order lets say m=rows=8, n=columns=10 and we want to delete a single row from it then look at the following example
![delete a row in a matrix](https://eevibes.com/wp-content/uploads/2021/12/delete-a-row-in-a-matrix-1024x280.png)
Here, I have used a built in random function for generating a matrix with random entries of 8 rows and 10 columns..
Now, lets assume that I want to remove 5th row completely, then I will use the following command
A([5],:) = []
once you run this command on MATLAB, you will get the following result
![delete a single row in matlab](https://eevibes.com/wp-content/uploads/2021/12/delete-a-single-row-in-matlab-1024x293.png)
Now it can be observed clearly that 5th row has been deleted
How to delete two rows in matlab
If you want to delete any two rows from above matrix A, say it 2, 3 then use the following syntax for it.
![deleting two rows in matlab](https://eevibes.com/wp-content/uploads/2021/12/deleting-two-rows-in-matlab-1024x251.png)
Also read here
https://eevibes.com/computing/how-to-take-integer-input-in-python/