meedshit

s6p1a_template

Jun 26th, 2017
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. clear; close all; clc;
  2.  
  3. run s6p1_params_template
  4.  
  5. % cvx_begin
  6. %
  7. % variables x(7) t;
  8. % maximize (t);
  9. % subject to
  10. % A*x == t*e;
  11. % x >= 0;
  12. % x <= d;
  13. %
  14. % cvx_end
  15.  
  16. c = zeros(1, 8); c(8)=1;
  17. % A = [A ; zeros(1,7)];
  18. % A = [A ; zeros(7,1)];
  19. A = [A -1*e];
  20.  
  21. % e = [e; 0]
  22.  
  23. M = eye(8); M(8,:)=[];
  24.  
  25.  
  26. cvx_begin
  27.  
  28. variables z(8);
  29. maximize (c*z);
  30. subject to
  31. A*z == 0;
  32. M*z >= 0;
  33. M*z <= d;
  34.  
  35. cvx_end
Add Comment
Please, Sign In to add comment