THMMY's "Optimization Techniques" course assignments.
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819
  1. function [flag] = BelongsTo(x, SetLimmits)
  2. %Checks if the x vector belongs to Set
  3. %
  4. % x: A vector to project
  5. % SetLimmits: The set to project. Each line/dimension off the set has to contain the limits
  6. % of the set to that particular dimension
  7. % flag: True if belongs
  8. %
  9. flag = true; % Have faith
  10. for i = 1:size(SetLimmits, 2)
  11. if x(i) < SetLimmits(i,1)
  12. flag = false;
  13. elseif x(i) > SetLimmits(i,2)
  14. flag = false;
  15. end
  16. end
  17. end