cannot find existing number
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Luis Eduardo Cofré Lizama
am 8 Jan. 2023
Kommentiert: Star Strider
am 8 Jan. 2023
I have the following data where fs =100;
tstamp =(1/fs:1/fs:12000*(1/fs))
Then when looking for the value 117 (find(tstamp == 117)), the results is [], however, the value does exist though with a trail of zeros (117.0000), is that the prob? how to solve?
Please help with this very likely simple prob.
cheers
Eduardo
0 Kommentare
Akzeptierte Antwort
Star Strider
am 8 Jan. 2023
Actually, I can’t reproduce that exact problem, since it works correctly here —
format long
fs =100;
tstamp =(1/fs:1/fs:12000*(1/fs))
v = find(tstamp == 117)
D = v - 11700
I was hoping to be able to demonstrate floating-point approximation error.
Oh well ...
.
3 Kommentare
Walter Roberson
am 8 Jan. 2023
There are various fairly obscure ways in which the floating point round-off algorithm can end up being changed. That does not happen often, but it can happen.
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Logical 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!