Is there a function to plot a function with logarithmic scale like 'semilogy' does?

조회 수: 3 (최근 30일)
I would like to plot a function, and it seems that there's only 'fplot' that can do it as what I've got is just a function rather than a set of data. However, I would like to plot the function with logarithmic scale without assigning a set of input to the function, and 'semilogy' doesn't work as I don't have the input data but the specified input interval.
%% a very simple example
syms x
y(x)=exp(x);
f1=matlabFunction(y)% how to plot the function with logarithmic scale without assigning a set of input?
Therefore, is there a function like a combination of 'fplot' and 'semilogy', which can help us plot the function with logarithmic scale without assigning a set of input to the function?

채택된 답변

Walter Roberson
Walter Roberson 2020년 7월 16일
Note that you can use fplot with Symbolic expressions and functions... but using matlabFunction can result in faster execution.
Anyhow, fplot and then set the axes properties XScale or YScale to 'normal' or 'log'
  댓글 수: 2
Shuangfeng Jiang
Shuangfeng Jiang 2020년 7월 16일
Thanks for answering.
This is a good idea, but it doesn't seem working.
Personally this is because the range of y is not big enough. Do you think so?The curve wasn't plotted with logarithmic scale
Walter Roberson
Walter Roberson 2020년 7월 16일
I can tell by the spacing that it is using log for the y axes. The 0.45 to 0.5 distance is about half of the 0.25 to 0.3 distance.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Title에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by