how can i get a slope in the loglog plot?
38 ビュー (過去 30 日間)
古いコメントを表示
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?
0 件のコメント
採用された回答
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
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).
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!