How can I write log(e) in MATLAB?

97 views (last 30 days)
I am trying to calculate x=log(e) but I can not. Any help?
  6 Comments
Walter Roberson
Walter Roberson on 16 Apr 2021
f = @(x) 4.^x - 256;
log4_256 = fzero(f, 1.2345)
log4_256 = 4
4^log4_256
ans = 256

Sign in to comment.

Accepted Answer

David Fletcher
David Fletcher on 15 Apr 2018
I assume you mean log10? In Matlab log is base e, so log(e)=1
x=log10(exp(1))
  6 Comments
sultana saffi
sultana saffi on 16 Apr 2021
can you help with this pleas x=log4(256)
John D'Errico
John D'Errico on 16 Apr 2021
@sultana saffi Please stop spamming this question with answers and comments to compute a log to do your homework.
Do you know the basic rule for logs to other bases?
The formula is given here:

Sign in to comment.

More Answers (0)

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!