So,
I tried to use Position to get the Position of the 90% Maximum of a Photodiode Signal. The code works when i directly use the solution of the .9*Max[...] solution, but I want to have it with a Variable in Position. The problem is as long as i dont use the numerical value but some variable I get a empty solution {}
My code right now is:
Position[datapd[6][[All, 2]], nearest[datapd[6]]]
(* {} *)
which is not working while:
Position[datapd[6][[All, 2]], 0.566794]
(* {{735}} *)
is giving me the right result...
while datapd is my {time,voltage}
list and nearest[datapd[6]]
is my code giving me the 90% of my Voltage maximum. The code for nearest[...]
is:
nearest[x_[nr_]] := Nearest[x[nr][[All, 2]], .9*Max[x[nr][[All, 2]]]]
which gives me for my datapd[6] list:
nearest[datapd[6]]
(* {0.566794} *)
I read something about Mathematica having Problems if the numbers of the Position input is somewhat different from the list element your looking for after some digits. But in my case the numerical value should be exactly the same.
I also tried using //N
and also giving Position
some condition with n_/;n==nearest[...]
but it wont do the thing but just run and run.
Does somebody has any advices to fix this problem?