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.
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:
Call +917738666252
Address Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
Chegg
chegg.com › engineering › computer science › computer science questions and answers › problem 1: matlab contains functions to calculate the natural logarithm (log), the logarithm to the base 10 (log10), and the logarithm to the base 2 (1092). however, if you want to find a logarithm to another base--for example, base b-you'll have to do the math yourself with the formula log.(x) log)(x) log.(b) what is the logs of 10 when b is defined from 1
Solved Problem 1: MATLAB contains functions to calculate the | Chegg.com
July 12, 2020 - Problem 1: MATLAB contains functions to calculate the natural logarithm (log), the logarithm to the base 10 (log10), and the logarithm to the base 2 (1092).
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 ·
Brainly
brainly.com › mathematics › college › matlab® contains functions to calculate the natural logarithm (log), the logarithm to the base 10 (log10), and the logarithm to the base 2 (log2).
[FREE] MATLAB® contains functions to calculate the natural logarithm (log), the logarithm to the base 10 (log10), - brainly.com
For example, log(10) returns approximately 2.3026, as e raised to the power of 2.3026 equals 10. Base 10 Logarithm (log10): This function is used to calculate the logarithm to the base 10.
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 ...
Repository https://github.com/runmat-org/runmat
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)....
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.