How to delete an element of a vector?

4 visualizzazioni (ultimi 30 giorni)
Given a vector v, containing elements from 1 to 10, I have to delete the elements of that vector that are equal to 10. For example
v=[1 10 3 4 10]
I have to obtain
v*=[1 3 4]
How can I do this?

Risposta accettata

Azzi Abdelmalek
Azzi Abdelmalek il 16 Mar 2016
Modificato: Azzi Abdelmalek il 16 Mar 2016
v=[1 10 3 4 10]  
w=v(v~=10)

%or

v(v==10)=[]

Più risposte (0)

Categorie

Scopri di più su Geoscience in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by