The log function does exactly what you want.
log(14 - y)
If you want a base 10 log, you use log10. There is also a log2 function, which gives a base 2 log. Other bases are achieved using the simple relation
log(X)/log(b)
produces a log to the base b. You could write a function for it as:
logb = @(X,b) log(X)/log(b);
logb(9,3)
ans =
2
which is as expected.
Finally, there is the reallog function, which also does the natural log, but it produces an error when the log would have been a complex number.
log(-2)
ans =
0.693147180559945 + 3.14159265358979i
reallog(-2)
Error using reallog
Reallog produced complex result.
But for the more normal case, reallog does the same thing as log.
log(2)
ans =
0.693147180559945
reallog(2)
ans =
0.693147180559945 Answer from John D'Errico on mathworks.com
Videos
MathWorks
mathworks.com › matlabcentral › answers › 431232-how-to-calculate-the-value-of-natural-log-e-in-matlab
How to calculate the value of natural log 'e' in Matlab? - MATLAB Answers - MATLAB Central
November 21, 2018 - One of the nice things about the Matlab doc, it that at the bottom of the page there are links to similar functions, so if Google gets you to exp, the 'See Also' gets to to log and log10. I'm sorry if I sounded a bit snarky btw. Sign in to comment.
MathWorks
mathworks.com › matlab › mathematics › elementary math
Exponents and Logarithms - MATLAB & Simulink
In addition to common functions like exp and log, MATLAB® has several other related functions to allow flexible numerical calculations. The expm1 and log1p functions compensate for numerical round-off errors in small arguments, while the reallog, realpow, and realsqrt functions restrict the ...
MathWorks
mathworks.com › matlab › mathematics › elementary math › exponents and logarithms
log - Natural logarithm - MATLAB
If the output of the function running on the GPU can be complex, then you must explicitly specify its input arguments as complex. For more information, see Work with Complex Numbers on a GPU (Parallel Computing Toolbox). For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox). This function fully supports distributed arrays. For more information, see Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox). ... The log function can calculate on all variables within a table or timetable without indexing to access those variables.
Northwestern University
ece.northwestern.edu › local-apps › matlabhelp › techdoc › ref › log.html
log (MATLAB Functions)
The log function operates element-wise on arrays. Its domain includes complex and negative numbers, which may lead to unexpected results if used unintentionally.
MathWorks
mathworks.com › matlabcentral › answers › 59158-how-to-represent-ln-in-matlab
how to represent ln in matlab? - MATLAB Answers - MATLAB Central
January 18, 2013 - Sign in to answer this question. ... The log() function is base-e log.
EDUCBA
educba.com › home › data science › data science tutorials › matlab tutorial › matlab log
Matlab log | Learn the different examples of Matlab log
March 8, 2023 - Matlab log method can be used to compute the natural logarithm or common logarithm of any number. It can also be used to compute the natural logarithm or common logarithm of an array of numbers or a matrix of numbers.
Call +917738666252
Address Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
Quora
quora.com › How-do-I-use-natural-logarithm-ln-in-matlab
How to use natural logarithm (ln) in matlab - Quora
For simple exponential application, . The use of logarithms is very practical, they simplify the solution of a problem . There are three laws for operations with logarithm : Multiplication.- Log€. X Z. = Log€ X + Log€ Y…………………. Log €X = Ln.X ... A power raised to a power. Ln X^n = n.Ln X ... S.A. Assistant professor in biophysics · Author has 619 answers and 1.8M answer views · 10y · Originally Answered: How do I use ln in matlab?
Cooper
faculty.cooper.edu › smyth › TechCompanion › Calc1 › Ch07 › NaturalLogs.htm
7.2 Natural Logarithms
>> e = exp(1) e = 2.7183 >> log(e) ans = 1 >> syms x t >> int(1/t, 1, x) ans = log(x) >> diff( log(x) ) ans = 1/x
EDUCBA
educba.com › home › data science › data science tutorials › matlab tutorial › natural log in matlab
Natural Log in Matlab | Learn How to Compute Natural Log in Matlab
May 31, 2023 - The value of e is given by 2.71828 and it is also denoted by a log. So, we should be careful while using a base in any logarithmic equation. In Matlab, natural logarithm is given by log(y) which represents the natural logarithm of y.
Call +917738666252
Address Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai