필터 지우기
필터 지우기

find rows with specific value

조회 수: 1 (최근 30일)
Amr Hashem
Amr Hashem 2015년 5월 12일
답변: Sean de Wolski 2015년 5월 12일
i have two excel sheets(a,b), and want to compare a(:,1) with b(:,1) and if equal show a&b
a & b sheets are:
i try: j=1; for i=1:size(alldata2,1) if isequal(alldata2{i,26},'MKJ') defs(j)=i; j=j+1; end end data2=alldata2(defs,:); % Failures of defibrillator
rowsize=length(defs);
data1=cell([rowsize,C2]); % create array with size [R,C]
for i=1:size(alldata,1)
for j=1:length(defs)
if data2{j,1}==alldata{i,1} % i think here is the problem
data1(j,:)=alldata(i,:) % put all data of text in array(data1)
end
end
end
defib_data_2002=[data2,data1]; % show device & text data
the code works good
but it remove the duplicated rows in file b
and i want all the data
how i can save all rows included the duplicated ones ?

답변 (1개)

Sean de Wolski
Sean de Wolski 2015년 5월 12일
doc ismember
doc intersect

카테고리

Help CenterFile Exchange에서 Text Files에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by