How to delete last number from a array?

조회 수: 622 (최근 30일)
Arnab Pal
Arnab Pal 2017년 11월 12일
댓글: Walter Roberson 2019년 6월 7일
I need, a=[8 9 5 8 7] to a=[8 9 5 8]. Every time I have to delete only last element. In my case, it will be complicated to delete like 5th element.
  댓글 수: 2
Jordan Garcia
Jordan Garcia 2019년 6월 6일
How do you make this possible with any size of row vector eliminating the final element for any size not just for a specific vector?
Walter Roberson
Walter Roberson 2019년 6월 7일
Birdman's answer already does that. end always refers to the last element no matter how large that is.

댓글을 달려면 로그인하십시오.

채택된 답변

Birdman
Birdman 2017년 11월 12일
a(end)=[];

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by