ismember on cell array and remplace values
Mostra commenti meno recenti
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 Commenti
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
il 21 Giu 2018
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Operators and Elementary Operations in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!