How to plot function using matlab?
조회 수: 1,087 (최근 30일)
이전 댓글 표시
how can I solve these problems using MatLab? 1.Use the plot command to plot the function f ( x ) = x 2 − 10 √ x + 2 for 0 ≤ x ≤ 5 . 2.Use the plot command to plot the function f ( x ) = ( 0.5 x 4 + 1.1 x 3 − 0.9 x 2 ) e − 0.7 x for − 3 ≤ x ≤ 10 .
댓글 수: 0
채택된 답변
madhan ravi
2018년 11월 1일
편집: MathWorks Support Team
2024년 6월 11일
syms x %requires symbolic toolbox
f = 2 * x - 10 * sqrt ( x ) + 2
figure
fplot(f,[0 5])
f1 = ( 0.5 * x * 4 + 1.1 * x * 3 - 0.9 * x * 2 ) * exp(1) - 0.7 * x
figure
fplot(f1,[-3 10])
%alternatively, you can use fplot, which is part of base MATLAB
f = @(x) x.^2 -10*sqrt(x) +2
fplot(f,[0 5])
댓글 수: 2
madhan ravi
2018년 11월 1일
you can use fplot by declaring the variable as symbolic like the above shown example
madhan ravi
2018년 11월 1일
if there is something which is not clear let know else accept the answer so that its understood that the question is solved.
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!