Relational Operator doesn't work
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
After a simulation I want to determine the limits of the axes using the relational operator ==. For example:
refTime = 0:2e-3:1.5;
t0 = 0.8;
find(refTime == t0)
this returns:
ans =
Empty matrix: 1-by-0
If I try the following in the same instance:
x = 0:10
find(x == 5)
It works and returns
ans = 6.
What could be wrong??
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 23 Mai 2013
Bearbeitet: Azzi Abdelmalek
am 23 Mai 2013
Try
refTime = 0:2e-3:1.5;
t0 = 0.8;
tolerence=1e-5
find(abs(refTime-t0)<tolerence)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Graphics Objects finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!