how can i get a slope in the loglog plot?

38 ビュー (過去 30 日間)
준형 박
준형 박 2022 年 9 月 14 日
編集済み: 준형 박 2022 年 9 月 15 日
i enter the data in "ID"
ID = [ 2.33879000000000e-19,
7.68704000000000e-17,
.....
0.00865008100000000,
0.00892525100000000,
0.00920535600000000 ] ( for ID(1,1)~ID(600,1))
loglog(ID);
i get a loglog plot for data ID,
and i want to get a slope of this loglog plot (at all point)
and i want to get a graph for this slope data
how can i do this?

採用された回答

Torsten
Torsten 2022 年 9 月 14 日
編集済み: Torsten 2022 年 9 月 14 日
ID = ...;
dID = gradient(log10((1:600).'),log10(ID));
loglog(ID)
hold on
plot(log10((1:600).'),dID)
  5 件のコメント
Torsten
Torsten 2022 年 9 月 14 日
編集済み: Torsten 2022 年 9 月 14 日
Why log(570/121) ?
If you use loglog(ID), you get a graph with x-coordinates log10(i) and y-coordinates log10(ID(i)).
The slope in a single x-coordinate is thus approximately log10(ID(i+1)/ID(i-1))/log10((i+1)/(i-1)).
But the difference between 570 and 121 is not 2 ( (i+1) - (i-1) = 2).
Or do you have an independent x-vector and you use
loglog(x,ID)
?
Because in your first contribution, you wrote loglog(ID) as plot command.
If you just want to calculate d(log10(ID))/d(log10(x)) between two given points as I suspect, then
i1 = 3;
i2 = 54;
slope_i2_i1 = log10(ID(i2)/ID(i1))/log10(i2/i1)
is the way to go.
But this is not the pointwise slope (thus an approximation to the loglog derivative).
준형 박
준형 박 2022 年 9 月 15 日
編集済み: 준형 박 2022 年 9 月 15 日
OK I understand
I think i misunderstood about x-coordinate
thank you for the reply.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by