the use of fplot function

조회 수: 4 (최근 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 CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by