Draw 3d Inequality on Matlab

前端 未结 1 560
被撕碎了的回忆
被撕碎了的回忆 2021-01-07 14:39

I\'m struggling to draw an inequality on Matlab. I need to draw a 3d dimensional space using the following constrains and function.The functions that I have are:

<         


        
相关标签:
1条回答
  • 2021-01-07 15:07

    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
    
    0 讨论(0)
提交回复
热议问题