Effacer les filtres
Effacer les filtres

How to remove unwanted elements of a array

50 vues (au cours des 30 derniers jours)
Donald
Donald le 14 Oct 2015
Commenté : Hyunjung Lee le 21 Avr 2021
I have two arrays with unwanted data at the beginning and end of each array (Stress and del L). What is an easy way to remove these elements?

Réponses (1)

WAT
WAT le 14 Oct 2015
Modifié(e) : WAT le 14 Oct 2015
If you want to get rid of indices 1 through 3 (for example) then
array(1:3) = [];
  1 commentaire
Hyunjung Lee
Hyunjung Lee le 21 Avr 2021
Thank you! I am not the original poster, but this helped me with removing array elements specified in an index vector. Before looking at your reply, I tried a(~idx,:) to try to only keep rows other than those specified by an index vector idx, but it didn't work. Thanks again!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Matrix Indexing 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