How to get mupad to plot solution points for inequalities?
Ältere Kommentare anzeigen
I am new to MuPAD and have just figured out how to graph inequalities using, for example:
plot(plot::Inequality([-x+y>=-2,x<=4],
x = -10..10, y = -10..10))
How do I get it to plot or print the solution/intersection points, i.e. (4,2) on the same graph or in the command line?
Am using MATLAB 2013a.
Thanks!
1 Kommentar
Antworten (1)
Christopher Creutzig
am 31 Mär. 2014
Bearbeitet: Christopher Creutzig
am 21 Mai 2014
The intersection of your boundaries will be on the boundaries (I know, not surprising), so you can simply say solve([-x+y = -2, x = 4]). If you want to include them in the plot, try something like this:
S := solve([-x+y = -2, x=4], [x, y], VectorFormat):
plot(plot::Inequality([-x+y >= -2, x <= 4],
x = -10..10, y = -10..10),
map(S, plot::Point2d, PointSize = 2, Color = RGB::Blue))
1 Kommentar
Tom
am 31 Mär. 2014
Kategorien
Mehr zu 2-D Function Plots finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!