how to write log base 2 in matlab coding
15 ビュー (過去 30 日間)
古いコメントを表示
expression for log base 2 in matlab coding
0 件のコメント
採用された回答
その他の回答 (1 件)
Andrew Rockhill
2022 年 9 月 16 日
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);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!