Rounding off and approximation functions.
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Reinhardt RADING
am 20 Apr. 2021
Kommentiert: Steven Lord
am 20 Apr. 2021
I have a matlab formula i.e,
Nsymb = (abs(Dcum)*deltaf(sp)*(lam^2)* Symbolrate* 1e-3)/clight
The value of Nysmb varies i.e 14, 10, 28, 36..
I would love to round off to the nearest power factor of 2. For example if Nsymb from the formula is 14, i want to write the code to make Nsymb = 16.
If Nysmb from the formula is 28, i want to make Nsymb =32... if 36, Nsymb=64.. so on.
How can i do this?
Thanks in advance.
3 Kommentare
the cyclist
am 20 Apr. 2021
Maybe I have not had enough coffee yet, but why would 36 round to 64? It is much closer to 32.
Or do you mean ceiling, and not round? Or maybe just a typo in your question?
Akzeptierte Antwort
Steven Lord
am 20 Apr. 2021
N = 14;
x = 2.^nextpow2(N)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spline Postprocessing 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!