Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

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

1 Ansicht (letzte 30 Tage)
Gowrinath S
Gowrinath S am 28 Jul. 2019
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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 Kommentar
Walter Roberson
Walter Roberson am 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];

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by