Info

此问题已关闭。 请重新打开它进行编辑或回答。

regarding the output graph, pls help me to correct my input..

1 次查看(过去 30 天)
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 个评论
Walter Roberson
Walter Roberson 2019-7-28
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];

回答(0 个)

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by