Hi guys I want to ask something I am new here. how can I plot the function f= x2 between the numbers -5 and 5
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi guys I want to ask something I am new here. how can I plot the function f= x2 between the numbers -5 and 5
댓글 수: 0
채택된 답변
Star Strider
2016년 2월 11일
I’m not certain what you want, but one of these should work:
x = linspace(-5,5);
f1 = x*2;
f2 = x.^2;
figure(1)
subplot(2,1,1)
plot(x, f1)
title('f(x) = x\cdot2')
grid
subplot(2,1,2)
plot(x, f2)
title('f(x) = x^2')
grid
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!