简体   繁体   English

在Matlab上绘制3d不等式

[英]Draw 3d Inequality on Matlab

I'm struggling to draw an inequality on Matlab. 我正在努力在Matlab上画一个不等式。 I need to draw a 3d dimensional space using the following constrains and function.The functions that I have are: 我需要使用以下约束和函数绘制3d三维空间。我拥有的函数是:

x>=5,000
y>=7,000
z>=3,000
3x+2y+5z<=53,000

And I can't come up with any idea how to do that, help will be very appreciated, thanks! 而且我不知道该怎么做,非常感谢您的帮助,谢谢!

Depending on how much work you can do before writing code there are different ways to do this. 根据编写代码之前可以完成的工作量,可以采用不同的方法。 The simplest is this: 最简单的是:

x=linspace(5000,53000/3); % create vectors for possible values of each variable
y=linspace(7000,53000/2);
z=linspace(3000,53000/5);
[X,Y,Z]=meshgrid(x,y,z);
I=(X>=5000) & (Y>=7000) & (Z>=3000) & (3*X+2*Y+5*Z<=53000); % combine all constraints
scatter3(X(I),Y(I),Z(I),'filled') % scatter plot, has many options which may prove useful

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM