how can i get a slope in the loglog plot?
38 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
준형 박
el 14 de Sept. de 2022
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 comentarios
Respuesta aceptada
Torsten
el 14 de Sept. de 2022
Editada: Torsten
el 14 de Sept. de 2022
ID = ...;
dID = gradient(log10((1:600).'),log10(ID));
loglog(ID)
hold on
plot(log10((1:600).'),dID)
5 comentarios
Torsten
el 14 de Sept. de 2022
Editada: Torsten
el 14 de Sept. de 2022
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).
Más respuestas (0)
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!