how to write log base 2 in matlab coding
조회 수: 3 (최근 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!