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
3 次查看(过去 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 中查找有关 Subplots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!