the use of fplot function

2 ビュー (過去 30 日間)
metin yilmaz
metin yilmaz 2020 年 11 月 9 日
回答済み: Ameer Hamza 2020 年 11 月 9 日
Would you please help me plot the function x^2 between [-2,2]?
This does not work, and would you please explain why that does not work? I think that fplot does not accept x^2 but why?
>> fplot(@(x^2)x, [-1,1]
fplot(@(x^2)x, [-1,1]
Error: Unexpected MATLAB operator.
Thank you.

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 11 月 9 日
Your syntax is wrong
fplot(@(x) x.^2, [-1,1])

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by