plot the following functions using axes that will produce a stright line

조회 수: 8 (최근 30일)
Jack
Jack 2012년 2월 23일
편집: Chong Tao 2013년 10월 21일
Can someone show me how to plot the following functions using axes that will produce a stright-line plot using Use the range 0 \< x \< 10
1) The power function y= 2x^-0.5 2) The exponential function y= 10^(1-x)
Thanks

채택된 답변

the cyclist
the cyclist 2012년 2월 23일
In the first case you can use loglog():
x = 1:0.1:10;
y = 2*x.^(0.5);
loglog(x,y)
In the second case you can use semilogy();
x = 1:0.1:10;
y = 10.^(1-x);
semilogy(x,y)
  댓글 수: 2
the cyclist
the cyclist 2012년 2월 23일
Please consider "accepting" this answer, since it sounds like it resolved your question.

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

추가 답변 (1개)

Honglei Chen
Honglei Chen 2012년 2월 23일
I don't quite understand what you mean by using axes. But if you use
loglog(x,y)
for the first function and
semilogy(x,y)
for the second function, they'll look like straight lines, basically taking advantage of logarithms.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by