How to eliminate a column from a matrix?

C =
C=[ 0.2474 -0.0311 0
0 0 0.5000 ]
I want to eliminate the last column. How to do it?

 Accepted Answer

C=[ 0.2474 -0.0311 0
0 0 0.5000 ];
C(:, end) = []; % remove last column
C
C = 2×2
0.2474 -0.0311 0 0

2 Comments

What if we want to remove the middle column?

Sign in to comment.

More Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Asked:

on 3 Sep 2021

Commented:

on 3 Sep 2021

Community Treasure Hunt

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

Start Hunting!