AnswerBun.com

Plotting multiple planes with three variables in 3D using MATLAB

I couldn’t figure out, how I could plot three different equations with three variables, namely x,y and z in MATLAB or any other Mathematical Softwares. I know that there’s a way we could plot multiple curves with two variables in MATLAB, but is there any alternative for 3D graphs, as such?

The question is related to Graphical Method in Linear Programming with 3 variables. These are the equations I need to plot in 3D, along with positivity constraints, ie. x=0, y=0 and z=0

x+y+z=450
7x+5y+13z=3000
0.05x+0.1y+0.2z=55

I tried researching a lot about 3D graphical method, but I just found that it’s too difficult to find the solution, hence we use Simplex method, as it is more efficient, but is it possible that this could also be solved by a graphical method, as such.

I also tried using CDF Player for Mathematica, but to no avail. Could anyone tell me if I could plot them manually too, as it seems 3D plotting is too difficult to do by hand.

Mathematics Asked on December 31, 2020

1 Answers

One Answer

$$x+y+z=450$$ isn't a function (well, it is an implicit curve), while

$$z=450-x-y$$

is. You can plot it using the following code:

x=[0:1:10];
y=[0:1:10]; 
[X,Y]=meshgrid(x,y); 
Z=450-X-Y; 
surf(X,Y,Z) 

You can also remove the positive values of $Z$, by using a little trick:

Z(Z<0)=nan;

Here, you are setting all negative values of $Z$ to Nan. Nan is skipped by Matlab when you plot something.

Answered by the_candyman on December 31, 2020

Add your own answers!

Related Questions

Tangent Bundle of Product Manifold

1  Asked on January 5, 2022

 

Is this proof of propositional logic valid

2  Asked on January 5, 2022 by mauricio-vega

 

Solving equation $y^2-2ln(y)=x^2$

1  Asked on January 5, 2022 by majdgh

   

Possible Rule of thumb for sums of variances?

2  Asked on January 5, 2022 by portmadeleinecrumpet

   

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved.