How to make a log plot in matlab

前端 未结 3 1837
Happy的楠姐
Happy的楠姐 2021-01-17 17:18

Is it possible to make a plot in matlab that does not actually take the logs of the values? I\'m plotting wide ranges of values and when I try to make a log plot of them, th

3条回答
  •  旧时难觅i
    2021-01-17 17:55

    Yes, it is possible. Use the loglog command.

    The example from the Mathworks website:

    x = logspace(-1,2);   % generate a sequence of points equally spaced logarithmically
    loglog(x,exp(x),'-s')
    grid on
    

    If you do not want both axes to be log scale, use semilogx or semilogy.

提交回复
热议问题