how to find the closest values with tolerance in a matrix given a specific value
23 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
kostas zervos
am 6 Sep. 2016
Bearbeitet: michio
am 6 Sep. 2016
Hi everyone, i have a problem finding values with tolerance in a matrix.In more detail, i have a 601x2201 matrix that contains option values, all i want is to find the closest values to 185.2 with +-0.02 tolerance and their indexes in the matrix.i have tried some codes to solve this(ismember,find,...) but always i end up with no answer.i would appriciate any help.Thank you for your time.
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 6 Sep. 2016
A=1000*rand(601,2201) ; % Example
tol=0.02
th=185.2
[ii,jj]=find(abs(A-th)<tol)
size(ii)
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!