find the equation of tangent to the curve y=2(x^1/2) at (1,2)

2 次查看(过去 30 天)
since i am new to matlab plese help me out with this assignment
find the equation of tangent to the curve y=2(x^1/2) at (1,2)
  3 个评论
Nishanth G
Nishanth G 2020-11-23
syms s(t) f(x)
f(x)=input("enter the function")
m=diff(f,x)
x1=input("enter the value of x for slope point")
y1=input("enter the value of y for slope point")
y=m*(x-x1)+y1
print(y
i got till this i need to apply x1 value in m , how do i do that ?

请先登录,再进行评论。

采纳的回答

Stephan
Stephan 2020-11-23
编辑:Stephan 2020-11-23
  1 个评论
Stephan
Stephan 2020-11-23
编辑:Stephan 2020-11-23
syms f(x)
f(x) = 2*(x^(1/2)) % symbolic function
Df = diff(f,x) % derivative
m = Df([1 2]) % values of slope for x=1 & x=2 in a vectorized manner
m_vals = double(m) % convert symbolic (exact) results to numeric

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by