how to remove the last column in the matrix?

Hello! There are matrices, I need to delete the last column, how would I do this?
A=[2 4 2 4 2 6 8];
[x,y]=size(A);
A(:, y) = [];
I try something like this, but I need to change the changed data to another array

 Accepted Answer

Stephen23
Stephen23 on 25 Jul 2019
Edited: Stephen23 on 25 Jul 2019
>> A = [2,4,2,4,2,6,8]
A =
2 4 2 4 2 6 8
>> B = A(1:end-1)
B =
2 4 2 4 2 6

More Answers (0)

Categories

Products

Tags

Asked:

on 25 Jul 2019

Edited:

on 25 Jul 2019

Community Treasure Hunt

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

Start Hunting!