how can i get a slope in the loglog plot?
조회 수: 37 (최근 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!