Im having an issue on my homework, When i type this:
hold off
syms x
p(x) = abs(x^2 - 5*x + 6)
ezplot(p(x),[1,4])
dq(c,h)=(p(c+h)-p(c))/h
limit(dq(2,h))
vpa(dq(2,h))
limit(dq(2,h),'left')
limit(dq(2,h),'right')
The last two lines
limit(dq(2,h),'left')
limit(dq(2,h),'right')
Give me an error stating that the limit point must be scalar. Im honestly unsure what that means and im not sure how to write this so any help would be greatly appreaciated, thanks!

 採用された回答

Star Strider
Star Strider 2019 年 2 月 10 日

0 投票

It does not appear that you have defined ‘h’, at least in the code you posted.
Have you defined ‘h’ anywhere in your code?

4 件のコメント

Quincy Walker
Quincy Walker 2019 年 2 月 10 日
On a previous question I have
syms c h
p(x) =abs( x^2 - 5*x + 6)
dq(c,h)=(p(c+h)-p(c))/h
But not speacifically just h by itself.
Star Strider
Star Strider 2019 年 2 月 10 日
This is still going to cause problems:
syms c x h
p(x) = abs(x^2 - 5*x + 6)
ezplot(p(x),[1,4])
dq(c,h)=(p(c+h)-p(c))/h
limit(dq(2,h))
vpa(dq(2,h))
limit(dq(2,h),'left')
limit(dq(2,h),'right')
for this reason:
Error using sym/limit (line 59)
Limit point must be a scalar.
Error in MyFile (line #####)
limit(dq(2,h),'left')
Give it a scalar and it will not throw the error.
Quincy Walker
Quincy Walker 2019 年 2 月 10 日
Thank You!
Star Strider
Star Strider 2019 年 2 月 10 日
My pleasure!
If my Answer helped you solve your problem, pleas Accept it!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Introduction to Installation and Licensing についてさらに検索

製品

リリース

R2018b

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by