Search for a range in a column
Afficher commentaires plus anciens
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 commentaires
the cyclist
le 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
le 1 Nov 2021
Réponses (1)
David Hill
le 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
Catégories
En savoir plus sur Programming dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!