find and omit element from array

16 vues (au cours des 30 derniers jours)
NA
NA le 14 Mar 2019
Modifié(e) : NA le 14 Mar 2019
vv=(1:100)'
A=[3;8;21;44;60;79;99]
f_vv=find(vv==A);
vv(reshape(f_vv,length(f_vv),1))=[];
I got this error
Dimensions of arrays being concatenated are not consistent.

Réponse acceptée

madhan ravi
madhan ravi le 14 Mar 2019
Modifié(e) : madhan ravi le 14 Mar 2019
21;44
% ^
vv(ismember(vv,A))=[]
  1 commentaire
madhan ravi
madhan ravi le 14 Mar 2019
Alternatively;
vv(~ismember(vv,A))

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices 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