如何在Matlab中以标准表示法求解线性编程? [英] How to solve a linear programing in matlab in canonical representation?

查看:93
本文介绍了如何在Matlab中以标准表示法求解线性编程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以像这样输入matlab字符串:

Is it possible to enter matlab a string like that:

MAX  140 x1 + 160 x2 +x3

SUBJECT TO

2 x1 + 4 x2 <= 28

5x1 + 5.333x2 -500X3 = 0

x1 <= 8

x2 <= 6

END

我已安装的工具箱:

v = ver; setdiff({v.Name},'MATLAB')'

v = ver; setdiff({v.Name}, 'MATLAB')'

ans =

'Aerospace Blockset'
'Aerospace Toolbox'
'Bioinformatics Toolbox'
'Communications System Toolbox'
'Computer Vision System Toolbox'
'Control System Toolbox'
'Curve Fitting Toolbox'
'DSP System Toolbox'
'Database Toolbox'
'Datafeed Toolbox'
'Econometrics Toolbox'
'Embedded Coder'
'Filter Design HDL Coder'
'Financial Derivatives Toolbox'
'Financial Toolbox'
'Fixed-Income Toolbox'
'Fixed-Point Toolbox'
'Fuzzy Logic Toolbox'
'Global Optimization Toolbox'
'IEC Certification Kit'
'Image Acquisition Toolbox'
'Image Processing Toolbox'
'Instrument Control Toolbox'
'MATLAB Builder JA'
'MATLAB Coder'
'MATLAB Compiler'
'MATLAB Distributed Computing Server'
'MATLAB Report Generator'
'Mapping Toolbox'
'Model Predictive Control Toolbox'
'Neural Network Toolbox'
'Optimization Toolbox'
'Parallel Computing Toolbox'
'Partial Differential Equation Toolbox'
'Phased Array System Toolbox'
'RF Toolbox'
'Robust Control Toolbox'
'Signal Processing Toolbox'
'SimBiology'
'SimDriveline'
'SimElectronics'
'SimEvents'
'SimHydraulics'
'SimMechanics'
'SimPowerSystems'
'SimRF'
'Simscape'
'Simulink'
'Simulink 3D Animation'
'Simulink Coder'
'Simulink Control Design'
'Simulink Design Optimization'
'Simulink Fixed Point'
'Simulink Report Generator'
'Simulink Verification and Validation'
'Stateflow'
'Statistics Toolbox'
'Symbolic Math Toolbox'
'System Identification Toolbox'
'SystemTest'
'Wavelet Toolbox'

推荐答案

签出 linprog :

f = [140, 160, 1]'; %'
A = [2 4 0];
b = 28;
Aeq = [5 5.3333 -500]
beq = 0
lb = -inf*ones(3,1);
ub = [8, 6, inf]';

x = linprog( f, A, b, Aeq, beq, lb, ub );

这篇关于如何在Matlab中以标准表示法求解线性编程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆