How to delete last number from a array?

716 vues (au cours des 30 derniers jours)
Arnab Pal
Arnab Pal le 12 Nov 2017
Commenté : Walter Roberson le 7 Juin 2019
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 commentaires
Jordan Garcia
Jordan Garcia le 6 Juin 2019
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 le 7 Juin 2019
Birdman's answer already does that. end always refers to the last element no matter how large that is.

Connectez-vous pour commenter.

Réponse acceptée

Birdman
Birdman le 12 Nov 2017

Plus de réponses (0)

Catégories

En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by