Show derivatives vector on a plot.

9 ビュー (過去 30 日間)
Antonio
Antonio 2013 年 11 月 22 日
編集済み: Antonio 2013 年 11 月 22 日
I've a curve plotted by the command plot(xx,oo) where xx and oo are coefficients obtained with Hermite interpolation method.
Now i want to show a little vector corresponding of some points (that i know) on the curve, that shows the derivative direction in these points.
Thank you

採用された回答

Bjorn Gustavsson
Bjorn Gustavsson 2013 年 11 月 22 日
Just use arrow or arrow3 with start-point at the corresponding point and end [dx,dy] away.
  2 件のコメント
Antonio
Antonio 2013 年 11 月 22 日
編集済み: Antonio 2013 年 11 月 22 日
Thank you but i think i have not well explained my problem.
I have a set of points P_i=(x_i,y_i) taken from a curve F(t)=(x(t),y(t)) . For each of these points i know the derivatives values (dx_i,dy_i) and i'd like to show the derivative's vector for which i already know them values (dx_i,dy_i).
Can i please have an example? (sorry 4 my bad english)
Antonio
Antonio 2013 年 11 月 22 日
編集済み: Antonio 2013 年 11 月 22 日
SOLVED ;)
c=diff(oo)./diff(pp);
c=[c,0];
d=0.3;
n=length(pp);
for i=1:n
rx = [pp(i)-d/2:0.1:pp(i)+d/2];
ry = zeros(1, length(rx));
for k=1:length(rx)
ry(k) = oo(i) + c(i)*(rx(k)-pp(i));
end
plot(rx, ry, 'red')
end

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by