blob: 01209cd9e9cddcf14309d77400f89c4bbe2eec7d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
//Key:
//f(x) : Objective Function
//ci(x)'s : Constraints
//Variable Declaration:
function [a] = f(x)
a = -2.0*x(1) - 1.6*x(2)
endfunction
//Calculation
X = [16820,1152]
//Result:
printf("Maximum Profit is $ %.0f /day or $ %f /year",-f(X),-365*f(X))
|