Linspace for logarithmic increasing values

Hi I'm trying to find out how to make say 100 points, representing a straight line in the loglog-scale.
The line is in theory represented by y=C*x^b, but in my example only start- and end points for the line.
I want to use something like linspace. The increment in x should still be constant. Are there any functions for this? Perhaps a function to find the constant values of C and b.
Best regards Peter

댓글 수: 2

Wayne King
Wayne King 2012년 5월 21일
I'm confused. A straight line in a loglog() plot comes from a power relationship, not an exponential.
x = 0:0.01:1;
b = 2;
y = 0.5*x.^b;
loglog(x,y)
Peter
Peter 2012년 5월 21일
Oh! I'm sorry!
I'll edit that

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

답변 (1개)

Wayne King
Wayne King 2012년 5월 21일

0 개 추천

Since you are really interested in a power relationship that will produce a straight line in a loglog plot, why can't you use linspace.
x = linspace(0,1,100);
b = 2;
y = 0.5*x.^b;
loglog(x,y)

댓글 수: 2

Peter
Peter 2012년 5월 21일
Its exactly that "y" im after but in my case the line isn't yet represented by a slope and a constant. The equation is perhaps easy to solve? I thought if there were any built in functions used to produce a discrete logarithmic function, from two points?
Thank you for the help by the way
Walter Roberson
Walter Roberson 2012년 5월 21일
logspace() ?

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

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

제품

질문:

2012년 5월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by