How to plot tangent segment?

3 visualizaciones (últimos 30 días)
Alessandro Musi
Alessandro Musi el 3 de En. de 2016
Comentada: Khaled Youssef el 9 de Abr. de 2020
I've plotted a simple function using a vector of nodes
I managed to compute for every nodes the tangent lines
I don't know how to plot only a tiny segment for every tangent, something like this possibly without the arrow
function[y]=tangent
nodes=[-5:5];
f=quadratic_function([-5:5]); %nodes^2
g=derivate_quadratic_function([-5:5]); %2*nodes
for k=1:length(nodes)
tang=(nodes-nodes(k))*g(k)+f(k);
plot(nodes,tang);
hold on;
end
plot(nodes,f);
hold on;
end
  3 comentarios
Sudhanshu Bhatt
Sudhanshu Bhatt el 8 de En. de 2016
Hi Alessandro,
Below are some threads that discuss this topic and can be used as a starting point:
Hope this helps.
Thanks
Sudhanshu Bhatt
Khaled Youssef
Khaled Youssef el 9 de Abr. de 2020
Hello,
Were you able to solve this issue?
Thanks,

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Programming en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by