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

30 ビュー (過去 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 Center および File ExchangeLine Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by