Microprocessorfile
Microprocessorfile
clear;
c = [2 3 4 7];
A = [2 3 -1 4; 1 -2 6 -7];
b = [8; -3];
if m <= n
sol = [];
for i=1:nCm
x = inv(A1) * b;
y(p(i,:)) = x;
end
end
z = c * sol;
[bfs, index] = max(z);
else
end
clc;
clear;
c = [1 2];
b = [10; 6; 1];
a = [1 2; 1 1; 1 -2];
x1 = 0: max(b)
x21 = max(x21, 0)
x22 = max(x22, 0)
x23 = max(x23, 0)
% plot(x1, x21);
% hold on;
% plot(x1, x22);
% plot(x1, x23);
title('Graphical Method');
xlabel('x1');
ylabel('x2');
c1 = find(x1==0)
c2 = find(x21==0)
c3 = find(x22==0)
c4 = find(x23==0)
line3 = [x1([c1 c4]); x23([c1 c4])]' %transpose to keep points row wise
pt = [0; 0]
a1 = a([i j], :)
b1 = b([i j])
pt = [pt x]
end
end
pt = pt'
end
s1 = find(const1 > 0)
s2 = find(const2 > 0)
s3 = find(const3 > 0)
s = unique([s1 s2 s3])
allpt(s, :) = []
allpt = allpt'
value = c * allpt
allpt = allpt'
x1 = allpt(index, 1)
x2 = allpt(index, 2)