ismember on cell array and remplace values
Afficher commentaires plus anciens
Hi, I am trying to use ismember and replace values but getting an error. Any hint? Thanks
c1={'ESP00021';'ESP00023';'ESP00023';'ESP00025'};
c2={'ESP00023';'ESP00025'};
d2=[5;26];
d2=num2cell(d2);
[~,idx] = ismember(c2,c1,'rows');
c1(idx) = d2;
error: Subscript indices must either be real positive integers or logicals. % probably because I have many repeated values in c1.
2 commentaires
What is the error? For starters though:
c1(idx) = d2;
using parentheses is trying to change an element of a cell array and will expect a cell to be passed to it.
sensation
le 21 Juin 2018
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Operators and Elementary Operations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!