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

16 次查看(过去 30 天)
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