removing rows in a loop of excel

2 次查看(过去 30 天)
Tian Tian
Tian Tian 2018-2-15
编辑: Birdman 2018-2-15
Hi, I want to compare paired excels in a folder. In the loop, i hope to select rows with columnB similar to previous one.
for i=1 : LengthB1 % B1 is the columnB from excel1
for j=1 : LengthB2 %B2 is the columnB from excel2
cellB1(i)=columnB1(i,1);
cellB2(j)=columnB2(j,1);
if cellB2(j)<=cellB1(i)*1.5 & cellB2>=cellB1*0.5
na=na+1
My questions are: 1) for i=1, j=5 and 10 both are good, but i want to get only one with the closest distance from B2 to B1 from j ; 2) for i=1, if j=5 is selected, then for i=2, i hope the loop of j can skip j=5. Can anyone give me a hand? Many thanks in advance.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Import from MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by