How to plot tangent segment?

조회 수: 3 (최근 30일)
Alessandro Musi
Alessandro Musi 2016년 1월 3일
댓글: Khaled Youssef 2020년 4월 9일
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
Sudhanshu Bhatt
Sudhanshu Bhatt 2016년 1월 8일
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 2020년 4월 9일
Hello,
Were you able to solve this issue?
Thanks,

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by