Info
This question is closed. Reopen it to edit or answer.
regarding the output graph, pls help me to correct my input..
1 view (last 30 days)
Show older comments
syms x y
f=input('x.^2');
x0=input('2');
y0=subs(f,x,x0);
fx=diff(f,x);
m=subs(fx,x,x0);
tangent=y0+m*(x-x0);
plotrange=[x0-3+x0-3];
ezplot(f,plotrange);
hold on;
ezplot(tangent,plotrange);
title('ploting of tangents')
t=sprintf('the tan to the curve y= %s at the point (%d,%d)is y= %s,f,x0,y0,tangent');
disp(t)
1 Comment
Walter Roberson
on 28 Jul 2019
plotrange=[x0-3+x0-3];
That is going to return a scalar, but ezplot() requires that it be passed a vector of two values. Perhaps you want
plotrange = [x0-3, x0+3];
Answers (0)
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!