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
🌐
MathWorks
mathworks.com › matlab › mathematics › elementary math › exponents and logarithms
log10 - Common logarithm (base 10) - MATLAB
For real values of X in the interval (0, Inf), log10 returns real values in the interval (-Inf ,Inf). For complex and negative real values of X, the log10 function returns complex values. ... Examine several values of the base 10 logarithm function. Calculate the common logarithm of 1. ... ...
🌐
MathWorks
mathworks.com › symbolic math toolbox › mathematics › mathematical functions
log10 - Log base 10 of symbolic input - MATLAB
Compute the log base 10 of symbolic input. The result is in terms of log. ... Convert symbolic output to double by substituting for x with a number using subs, and then using double. fLog10 = subs(fLog10,x,5); % x is 5 fLog10 = double(fLog10) ... Input, specified as a number, vector, matrix, ...
🌐
Johns Hopkins University
math.jhu.edu › ~shiffman › 370 › help › techdoc › ref › log10.html
log10 (MATLAB Function Reference)
Description The log10 function operates element-by-element on arrays. Its domain includes complex numbers, which may lead to unexpected results if used unintentionally. Y = log10(X) returns the base 10 logarithm of the elements of X.
🌐
Northwestern University
ece.northwestern.edu › local-apps › matlabhelp › techdoc › ref › log10.html
log10 (MATLAB Functions)
The log10 function operates element-by-element on arrays. Its domain includes complex numbers, which may lead to unexpected results if used unintentionally. Y = log10(X) returns the base 10 logarithm of the elements of X.
🌐
MathWorks
mathworks.com › matlabcentral › answers › 1465394-how-do-i-calculate-a-logarithm-of-a-variable-base
How do I calculate a logarithm of a variable base? - MATLAB Answers - MATLAB Central
October 2, 2021 - https://www.mathworks.com/matl... % natural log · ans = 1×2 · 2.3026 2.3026 · [log10(5),logb(5,10)] % log(10) to base 5 ·...
🌐
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 - log10(5) [Passing 5 as an argument to the log10 method as we need its common logarithm] [Mathematically, the log of 5 to the base “10” is 0.6990] This is how our input and output will look like in the Matlab command window:
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 ln you use y=log(x). For log base 10 you use y=log10(x). ... M.K. Nithya Pranita · B.E from RMK College of Engineering and Technology (Graduated 2022) · Author has 669 answers and 158.6K answer views · 6y · Y = log( X ) returns the natural ...
Find elsewhere
🌐
MathWorks
mathworks.com › matlabcentral › answers › 761576-log-base-10-plot
log base 10 plot - MATLAB Answers - MATLAB Central
March 3, 2021 - U_Ps = Ps_ko + Ps_k1*(log10(Z)); Y_Ps = Co + C1*U_Ps + C2*U_Ps^2 + C3*U_Ps^3 + C4*U_Ps^4 + C5*U_Ps^5 + C6*U_Ps^6 + C7*U_Ps^7 + C8*U_Ps^8 + C9*U_Ps^9 + C10*U_Ps^10 ... + C11*U_Ps^11 + C12*U_Ps^12 + C13*U_Ps^13; end · loglog(Z, Y_Ps) axis( [0.01 100 0.01 1]) % loglog(Z, Y_Ps) % axis( [0.01 100 0.001 100000]) % grid on · Sign in to comment. Sign in to answer this question. Share · Follow Question · Rik on 3 Mar 2021 · Ran in: Open in MATLAB Online ·
🌐
Quora
quora.com › How-can-I-implement-log-ln-and-e-in-MATLAB
How to implement log, ln, and e in MATLAB - Quora
MATLAB already provides the standard ... here are concise, reliable approaches. ... Natural log: log(x) returns ln(x) (base e). Base-10 log: log10(x)....
🌐
RunMat
runmat.com › docs › reference › log10
log10 | MATLAB Language Function Reference | RunMat
February 18, 2026 - Y = log10(X) computes the base-10 logarithm of every element in X, following MATLAB's numeric semantics for real, logical, character, and complex inputs. Negative real values promote to complex results so that you can analyze magnitudes without ...
🌐
MathWorks
mathworks.com › matlabcentral › answers › 140987-how-do-i-write-20logbase10-in-matlab
how do i write 20logbase10 in matlab - MATLAB Answers - MATLAB Central
July 8, 2014 - https://www.mathworks.com/matlabcentral/answers/140987-how-do-i-write-20logbase10-in-matlab#comment_224654 ... My pleasure! You should have gotten the same result in your script as with the Command Window if you entered the same commands, unless you somehow implicitly converted a1 to double before you issued your Command Window call to log10.
🌐
MathWorks
mathworks.com › matlabcentral › answers › 196506-log-vs-log10-plot
LOG vs LOG10 plot - MATLAB Answers - MATLAB Central
April 7, 2015 - Share · Follow Question · Michael ...rs/196506-log-vs-log10-plot#answer_174280 · Cancel Copy to Clipboard · loglog is to the base of 10 (just see the axis scale)....