Hi Henrick, give this a shot -- The example is non-symmetric.
In[]:=
exampleMat=ExampleData[{"Matrix","LPnetlib/lp_fit1d"}];Print["SymmetricMatrixQ[exampleMat] = ",SymmetricMatrixQ[exampleMat]];valueOfInterest=102.5;percent=N[0.1/100];(*0.1%*)extent=Max[exampleMat]-Min[exampleMat];width=percent*extent;lowerB=valueOfInterest-width;upperB=valueOfInterest+width;Print["{lowerB,valueOfInterest,upperB} = ",Row[{lowerB,valueOfInterest,upperB},", "]];{rows,columns}=Dimensions[exampleMat];results=Flatten[Table[Table[If[lowerB≤exampleMat[[i,j]]≤upperB,{{i,j},exampleMat[[i,j]]},Nothing],{j,1,columns}],{i,1,rows}],1];Print["results:"];Print[results//Column];
SymmetricMatrixQ[exampleMat] = False
{lowerB,valueOfInterest,upperB} = 99.434, 102.5, 105.566
results:
{{5,37},104.} |
{{5,59},100.} |
{{5,181},100.} |
{{5,629},104.} |
{{5,785},100.} |
{{9,113},102.} |
{{9,295},102.} |
{{9,419},100.} |
{{9,439},102.} |
{{12,99},100.} |
{{12,303},100.} |
{{12,653},100.} |
{{12,707},100.} |
{{12,803},100.} |