On 4/19/2011 2:36 PM, Neeta wrote:
> Do you think a plot editor or curve fitting tool provides an option
> to plot a tangent on a data point of a curve. If not, what is
> the plot instruction that can be used on command window?
There is probably 101 ways to do this. There might
be allready one command to do it in Matlab.
But here is a hack. If you want to do it symbolically,
then just find the slope, and find equation of the line at
the point, and plot the tangent.
Here is an example for plotting tangent of sin(t) at
some point just for illustration.

clear all; close all;
syms t
x2 = pi/5; %point to plot tangent
f = sin(t); %function to take slope of
m = subs(diff(f,t),t,x2); %find slope at x2
y2 = subs(f,t,x2);
intercept = m*x2+y2;
ezplot(f,[0,2*pi]); % plot f(t)
hold on;
ezplot(m*t+intercept,[0,2*pi]); %plot tangent
h = get(gca,'children');
set(h(1),'color','red');
title(sprintf('tangent of sin(t) at x=%f',x2));
plot(x2,y2,'*');
ylim([2 2])

You could do it numerically also if you want.
HTH,
Nasser
