WHAT IS THE WRONG HERE?
    4 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Amr Hashem
      
 il 14 Mag 2015
  
    
    
    
    
    Commentato: Amr Hashem
      
 il 15 Mag 2015
            I AM TRYING TO FIND ALL CELLS IN A WICH EQUAL B THE CODE :
for j=1:length(defs)     % loop over Mdr of defib
   querymdr=data2(:,1);          % "A" save MDR numbers
y=alldata(:,1);         % "B"
idx=  find(y==querymdr);    % FIND ALL CELLS WHICH IS EQUAL
it gives me an error in
idx=  find(y==querymdr);
what was i write wrong?
3 Commenti
Risposta accettata
  Walter Roberson
      
      
 il 14 Mag 2015
        querymdr = cellfun(@(C) C{1}, data2);   %presuming the first entry is a scalar!
ally = cellfun(@(C) C{1}, alldata);     %presuming the first entry is a scalar!
Now you have two numeric vectors to compare. What you would do from there would depend on whether you are expecting multiple matches for each entry.
5 Commenti
  Walter Roberson
      
      
 il 15 Mag 2015
				What error message does it give you?
Please show
class(data2)
class(alldata);
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Data Import and Analysis 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!




