Notation question: $x\ln^2(1000/y)$ into MATLAB
Sebastian Wright
I've been tasked with working out how much some incorrectly entered calibration coefficients have affected some measurements we've taken. I have the algorithm used, which I can use to work backwards and get some error ranges, but I'm a bit stuck on notation.
The algorithm reads, in part:
$x\ln^2(1000/y)$
but I'm a but flummoxed on how to translate this into, say, MATLAB syntax - especially the $\ln^2$ part.
Sorry for the stupid question, but this is out of my field a fair bit, and high school maths class was a long time ago...
$\endgroup$ 22 Answers
$\begingroup$I would like to add that if you need to work on a vector value of x and y you will have to put a "dot" before the ^2
x.*(log(1000/y)).^2
This reads "preform the operation of squaring on every component of x and y separately"
$\endgroup$ $\begingroup$My guess is x * log(1000/y)^2.
Basic functions sometimes put powers of two before the parentheses. It's a common practice for trigonometric functions, even though I can't recall seeing it for ln.
$\endgroup$