필터 지우기
필터 지우기

How to plot this in MATLAB

조회 수: 1 (최근 30일)
S. David
S. David 2011년 4월 5일
Hi,
How to plot the following inequality in MATLAB in 3D:
Ax<=b
where A is an m-by-n matrix, x is an n-by-1 vector, and b is an m-by-1 vector??
Thanks in advance
  댓글 수: 6
Andrew Newell
Andrew Newell 2011년 4월 5일
How many dimensions are involved? It's very hard to visualize greater than 3 dimensions.
S. David
S. David 2011년 4월 5일
Let us say 2D or 3D, not more. How can we do that?

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

답변 (3개)

the cyclist
the cyclist 2011년 4월 5일
A clever way to do this might be to use the "convhull" command, if you can generate a dataset that obeys that relationship.
  댓글 수: 1
S. David
S. David 2011년 4월 5일
Suppose all are given. How to plot it?

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


Sean de Wolski
Sean de Wolski 2011년 4월 5일
  댓글 수: 1
S. David
S. David 2011년 4월 5일
Thanks you, the code is not very much understandable. Can you comment on it, please?

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


the cyclist
the cyclist 2011년 4월 6일
I sat down and thought about this more carefully, and I think the question is a little ambiguous, in a couple different ways.
Let's look at the simplest possible example:
A = eye(2);
b = ones(2,1);
First, it is not perfectly clear what is meant by Ax<=b, because that is the comparison of two vectors, and there is no less than or greater than relationship between them. For example, if Ax = [2; 3] and b=[3; 2], then does the inequality hold?
Maybe it means, though, that every element of Ax must be less than b. If that is the case, then I guess we want to find the boundary. This is solution to A*x=b. (Note that this is now a strict equality now.) I have not done real matrix algebra in a while, but I believe the best way to do this in MATLAB is
x_boundary = A\b
which means in our simple case that x_boundary = [1;1].
So, it seems you want a plot of the region where x <= x_boundary. That's a semi-infinite region, methinks. Not sure how you want to plot that.
Hope that helps a little. It's been a while since I've thought about this type of math, so be sure to do your own thinking on this and see if it makes sense.
  댓글 수: 1
S. David
S. David 2011년 4월 7일
Basically, Ax<=b is a polyhedron, and it is bounded, you just have to get the correct matrix A and vector b. As an example, let us say:
A=[1 1 1;1 1 -1; 1 -1 1; 1 -1 -1;-1 1 1;-1 1 -1;-1 -1 1;-1 -1 -1;];
b=[1;1;1;1;1;1;1;1]
These A and b, assures that the polyhedron is convex. The question now, given these A and b, how to plot the bounded polyhedron?
Thanks in advance

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

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by