# matrix inverse, swap columns and rows

6 views (last 30 days)
Thomas Kozinski on 12 Mar 2021
Answered: ANKUR KUMAR on 12 Mar 2021
Hello, I have a matrix A as below and I have some problem with completing the steps below.
A = randi([-10,10],5,10)
I have to do:
1.swap the first line/row with the third one
2.swap the columns: second with fourth, sixth with eighth and the tenth with the first
3.using the empty matrix concept [] remove the fifth, sixth and tenth columns.
##### 2 CommentsShowHide 1 older comment
Adam Danz on 12 Mar 2021
Edited: Adam Danz on 12 Mar 2021

ANKUR KUMAR on 12 Mar 2021
This looks like a homework problem. Here are some hints you can use it:
A = randi([-10,10],5,10)
%for swapping rows
A([1 2],:)=A([2 1],:);
% for swapping columns
A(:,[2,4])=A(:,[4,2]);
% removing columns
A(:,[5,6,10])=[];

### Categories

Find more on General Applications in Help Center and File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!