How to round numbers to specific near point?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Triveni
am 22 Jun. 2022
Beantwortet: Stephen23
am 22 Jun. 2022
I have a vector
A =
6.1
6.04
5.98
5.92
5.86
5.8
5.74
5.69
5.63
5.57
5.52
5.46
5.41
i want to round it near 0.05,
A =
6.1
6.05
6
5.9
5.85
.
.
.
Please help me.
0 Kommentare
Akzeptierte Antwort
Stephen23
am 22 Jun. 2022
A = [6.1;6.04;5.98;5.92;5.86;5.8;5.74;5.69;5.63;5.57;5.52;5.46;5.41]
N = 0.05;
B = round(A/N)*N
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing 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!