How To Delete ROW/COLUMN in MATLAB

In previous post on matlab tutorial we have discussed about How to apply WHILE loop in MATLAB.


Now in Post-20 of Module-01, we will discuss about how to delete row/column in matlab, for which a matlab program has been given in figure-1.

Figure.1 - MATLAB Program to delete row/column.

First of all user is asked to enter any matrix which is done with the help of command written in line-3 and stored it in variable 'A'. This matrix is also displayed to the user for the selection purpose with the help of command written in line-4. Now user is asked to enter the row number and after that column number which he want to delete. This is done with the help of command written in line-5 and line-6. Selected row is deleted with the help of command written in line-7 while selected column is deleted with the help of command written in line-8. After this updated matrix has been displayed with the help of command written in line-9. The command window output of above written matlab program has been given in figure-2.

Figure.2 - Command Window output to delete row/column in MATLAB.

MATLAB Program has been called by typing its name 'mod0120' on command window. After which a message 'Enter any Matrix' is displayed on command window. Then a 3x3 matrix has been typed which display after you press enter key. Now Again a message 'Enter row number which you want to delete' is displayed. When you enter any number within the matrix dimension then a message 'Enter column number which you want to delete' is displayed also. When you enter number within matrix dimension then it display a updated matrix after deleting selected row and column.

Video Tutorial : How To Delete Row and Column in MATLAB By INFO4EEE


Brought to you by INFO4EEE (Website, Channel, and Classes).

No comments

Powered by Blogger.