Search for a range in a column
Show older comments
I need to search for each individual number in a column with a plus/minus range and see if that range is present in another column. Is this posible with Matlab.
2 Comments
the cyclist
on 29 Oct 2021
Your question is not very clear at all (at least to me). Please spend more than 1 minute and 2 sentences to describe what you are trying to do. A small example of an input and output would be very helpful.
Pedro Rossi
on 1 Nov 2021
Answers (1)
David Hill
on 1 Nov 2021
m=yourMatrix;
t=.00001;
for k=1:size(m,1)
c{k}=find(m(:,2)>=m(k,1)-t&m(:,2)<=m(k,1)+t);%use cell array if there can be more than one
end
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!