WHAT IS THE WRONG HERE?
    조회 수: 4 (최근 30일)
  
       이전 댓글 표시
    
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?
채택된 답변
  Walter Roberson
      
      
 2015년 5월 14일
        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
  Walter Roberson
      
      
 2015년 5월 15일
				What error message does it give you?
Please show
class(data2)
class(alldata);
추가 답변 (0개)
참고 항목
카테고리
				Help Center 및 File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




