필터 지우기
필터 지우기

The easiest way to add a line of determined slope to a loglog

조회 수: 16 (최근 30일)
Ivan Volodin
Ivan Volodin 2017년 3월 18일
댓글: Ivan Volodin 2017년 3월 18일
Hello! I have a graph made by
loglog();
and I would like to add determined slope. I am not saying about linear fit or trend. I am interested to add a line of determined slope to a loglog.
Imagine that we have this:
clear;clc;clf;
f= ; % some argument input
Spectrum_Power =;% somefunction of f
loglog(f,Spectrum_Power);
grid on;
And how to add a slope of -5/3 to this plot? Thanks in advance!

채택된 답변

David Goodmanson
David Goodmanson 2017년 3월 18일
Hello Ivan, A straight line of slope -5/3 on a loglog plot has the form log(y) = (-5/3)*log(x) + b with an arbitrary constant b. Exponentiating both sides gives
y = c*x.^(-5/3);
with a constant c = exp(b) which is arbitrary except that c > 0. So the form above with any positive c will give the requisite straight line on a loglog plot.

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by