how to make a figure of the square root on the interval [0,2]. The figure should be smooth, not angular?

답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 11월 8일

1 개 추천

One way is to use fplot()
f = @(x) sqrt(x)
fplot(f, [0 2])

댓글 수: 4

Jens Petit-jean
Jens Petit-jean 2020년 11월 8일
thanks, but why do you use the @ in front of (x)?
Ameer Hamza
Ameer Hamza 2020년 11월 8일
This creates a function handle. Read about function handle here: https://www.mathworks.com/help/matlab/function-handles.html
Jens Petit-jean
Jens Petit-jean 2020년 11월 8일
okay thank you very much!
Ameer Hamza
Ameer Hamza 2020년 11월 8일
I am glad to be of help!!!

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

질문:

2020년 11월 8일

댓글:

2020년 11월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by