Plotting a graph with multiple constraints
显示 更早的评论
Im having trouble trouble plotting a function given multiple constraints.
For example where f(x) = cos(x)
Constraints
x>=2
x<=5
I was wondering how i could plot this graph on matlab showing both the constrains given,
Thanks in Advance for your help
回答(1 个)
Peng Li
2020-3-26
0 个投票
x >= 2 & x <= 5
this express will consider both constraints in. Is this what you need?
2 个评论
Mithuisan Sutharsan
2020-3-26
Peng Li
2020-3-26
x = 2:.1:5;
y = cos(x);
plot(x, y);
is this what you need?
类别
在 帮助中心 和 File Exchange 中查找有关 Histograms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!