Logarithmic scale in MuPAD

396 Views Asked by At

I had to plot a function, $e_n=\ln(n!)-n\ln(n)+n$, relative to a logarithmic scale. In MATLAB, I could do it simply by using semilogx but in MuPAD I can't find such a command. How can I do so?

1

There are 1 best solutions below

0
On BEST ANSWER

As aforementioned I got answer for the question after offering bounty in stackoverflow. For good order, I'll quote the original answer:

CoordinateType attribute allows us to switch between linear and logarithmic plots.

By default CoordinateType is set to LinLin i.e. linear plots. There are 3 cases of logarithmic 2d plots.

Semilog Plots

  • LinLog - Linear coordinates are plotted along the horizontal axis, >logarithmic coordinates along the vertical axis. Functions of form y = >exp(c1*x+c2) become straight lines. E.g. plot(plot::Function2d(exp(x), x = 0 .. 100), CoordinateType = LinLog): enter image description here
  • LogLin - Logarithmic coordinates are plotted along the horizontal axis, >linear coordinates along the vertical axis. Functions of form y = c1 ln(x) + c2 >become straight lines. E.g. plot(plot::Function2d(5*log(10,x) + 8, x = 1 .. 100),CoordinateType = >LogLin):

enter image description here

Logarithmic Plots

  • LogLog - Logarithmic coordinates are plotted along both axes. E.g. >plot(plot::Function2d(sqrt(5*x) + x^4, x = 10^(-3) .. 10^3), CoordinateType = >LogLog):

enter image description here