how to write log base 2 in matlab coding
Mostra commenti meno recenti
expression for log base 2 in matlab coding
Risposta accettata
Più risposte (1)
Andrew Rockhill
il 16 Set 2022
0 voti
To find the log in any base, make use of the base-change formula:
log_b(x) = log_a(x)/log_a(b)
So you can create a function logb = @(b,x) log(x)/log(b);
Then Y = logb(2,x);
Or, more generally;
Y = logb(b,x);
Categorie
Scopri di più su Symbolic Math Toolbox in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!