필터 지우기
필터 지우기

How to plot 100a +75b +50c - (100b) in matlab?

조회 수: 1 (최근 30일)
K R
K R 2017년 5월 15일
답변: KSSV 2017년 5월 15일
I need to plot Max z = 100A + 75B+ 50C
Constraints: A+B+C=100, A≥0, B≥0, C≥0
  댓글 수: 1
Rik
Rik 2017년 5월 15일
What is it exactly you want to plot against what? Because of your constraints this 4D system can be reduced to at least 3D, so you can plot valid (A,B,z) points.
Have a read here and then clarify your question so we can help you along. Right now it is impossible to know if you need surf or solve.
(Oh, and show that you put in effort, people will be more likely to try to help if you do)

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

답변 (1개)

KSSV
KSSV 2017년 5월 15일
N = 10 ;
A = linspace(0,100,N) ;
B = linspace(0,100,N) ;
C = linspace(0,100,N) ;
[A,B,C] = ndgrid(A,B,C) ;
thesum = A+B+C ;
idx = find(thesum==100) ;
z = 100*A(idx) + 75*B(idx)+ 50*C(idx) ;
scatter3(A(idx),B(idx),C(idx),z,z,'.')

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by