필터 지우기
필터 지우기

How to get mupad to plot solution points for inequalities?

조회 수: 3 (최근 30일)
Tom
Tom 2013년 9월 23일
편집: Christopher Creutzig 2014년 5월 21일
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
Brian
Brian 2014년 1월 9일
편집: Brian 2014년 1월 9일
I don't think you can type it in the command line. the way I would do it is type >> mupad in the command window, and then!!! type
"plot(plot::Inequality([fill in]))" in the mupad window

댓글을 달려면 로그인하십시오.

답변 (1개)

Christopher Creutzig
Christopher Creutzig 2014년 3월 31일
편집: Christopher Creutzig 2014년 5월 21일
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
Tom
Tom 2014년 3월 31일
Better late than never! Thank you for your answer. Unfortunately I get the message - "Error: An equation is expected. [rhs]" when trying to plot.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 2-D Function Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by