Clear Filters
Clear Filters

Antilog formula in matlab

66 views (last 30 days)
nichapat asayakhun
nichapat asayakhun on 4 Aug 2021
Commented: Stephen23 on 19 Sep 2023
How can I put this function of inverselog in matlab code. Where A and B is the constant.

Answers (2)

Chunru
Chunru on 4 Aug 2021
tmp = 1og10((W_TO-A)./B);
W_E = 10.^(tmp); % check out the definition of invlog10; it should be 10^x

David Gordon
David Gordon on 18 Sep 2023
wHY IS HELP IN MATLAB SO CRAPPY??????
TO understand your answers I need to understand matlab which is why i'm using matlab help!!! uselesssssssss!!!!!!!
How can I take 10^(1x1651 double vaiable) ?????????
  2 Comments
John D'Errico
John D'Errico on 18 Sep 2023
Edited: John D'Errico on 18 Sep 2023
Yours is not an answer to the question. It is just a rant, due to your not understanding how to use the language. It just means you needed to read the manual, or perhaps better yet, to do one of the many tutorials you could find.
However, if you want to form an element-wise power operation, you need to use the element-wise operator, thus .^ operator. For example...
P = 1:.5:3
P = 1×5
1.0000 1.5000 2.0000 2.5000 3.0000
format short g
10.^P
ans = 1×5
1.0e+00 * 10 31.623 100 316.23 1000
So we see 10 raised successively to each of those powers.
The power operator that does not have a dot in it is used for linear algebra operatios, essentially when the arguments are not scalars. If both arguments are scalars, then the two operators are the same. Since MATLAB is a language designed to be used for linear algebra by the rest of us, it makes sense there need to be two sets of operators.
Stephen23
Stephen23 on 19 Sep 2023
"wHY IS HELP IN MATLAB SO CRAPPY??????"
You are using MPOWER operator (which is the wrong operation). When you scroll to the bottom of the MPOWER documentation it contains links to other related functions including POWER (which is the correct operation). Note that both of those pages also link to this important page:
which explains fundamental information that is important to understand about such numeric operations.
When you get stuck using MATLAB start by reading the documentation of the operator that you are already using (e.g. MPOWER) and also take the time to read anything that the its documentation links to. If you do not do that then it will be very hard to learn to use MATLAB.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!